Skip to content

Commit 84a404d

Browse files
committed
Fix tests about read_only in the session
1 parent df83038 commit 84a404d

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

tests/TestCase/Controller/GithubControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getFixtures(): array
6060
public function setUp(): void
6161
{
6262
parent::setUp();
63-
$this->session(['Developer.id' => 1, 'access_token' => 'abc']);
63+
$this->session(['Developer.id' => 1, 'access_token' => 'abc', 'read_only' => false]);
6464
$this->Reports = TableRegistry::getTableLocator()->get('Reports');
6565
$this->enableCsrfToken();
6666
}

tests/TestCase/Controller/NotificationsControllerTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,21 @@ public function setUp(): void
3737
{
3838
parent::setUp();
3939
$this->Notifications = TableRegistry::getTableLocator()->get('Notifications');
40-
$this->session(['Developer.id' => 1, 'read_only' => true]);
4140
$this->enableCsrfToken();
4241
}
4342

4443
public function testIndex(): void
4544
{
45+
$this->session(['Developer.id' => 1, 'read_only' => false]);
46+
47+
$this->get('notifications');
48+
$this->assertResponseCode(200);
49+
}
50+
51+
public function testIndexReadOnly(): void
52+
{
53+
$this->session(['Developer.id' => 1, 'read_only' => true]);
54+
4655
$this->get('notifications');
4756
$this->assertResponseCode(307);
4857

0 commit comments

Comments
 (0)