77use App \Test \Fixture \IncidentsFixture ;
88use App \Test \Fixture \NotificationsFixture ;
99use App \Test \Fixture \ReportsFixture ;
10+ use Cake \ORM \Query ;
1011use Cake \ORM \TableRegistry ;
1112use Cake \TestSuite \IntegrationTestTrait ;
1213use Cake \TestSuite \TestCase ;
@@ -37,6 +38,7 @@ public function setUp(): void
3738 parent ::setUp ();
3839 $ this ->Notifications = TableRegistry::getTableLocator ()->get ('Notifications ' );
3940 $ this ->session (['Developer.id ' => 1 , 'read_only ' => true ]);
41+ $ this ->enableCsrfToken ();
4042 }
4143
4244 public function testIndex (): void
@@ -61,12 +63,13 @@ public function testMassAction(): void
6163 ],
6264 ]
6365 );
66+ $ this ->assertResponseCode (302 );
6467
6568 $ notifications = $ this ->Notifications ->find ('all ' , fields: ['Notifications.id ' ]);
66- $ this ->assertInstanceOf (' Cake\ORM\ Query' , $ notifications );
69+ $ this ->assertInstanceOf (Query::class , $ notifications );
6770 $ actual = $ notifications ->enableHydration (false )->toArray ();
6871 $ expected = [
69- ['id ' => ' 2 ' ],
72+ ['id ' => 2 ],
7073 ];
7174 $ this ->assertEquals ($ actual , $ expected );
7275
@@ -75,9 +78,10 @@ public function testMassAction(): void
7578 '/notifications/mass_action ' ,
7679 ['mark_all ' => 1 ]
7780 );
81+ $ this ->assertResponseCode (302 );
7882
7983 $ notifications = $ this ->Notifications ->find ('all ' , fields: ['Notifications.id ' ]);
80- $ this ->assertInstanceOf (' Cake\ORM\ Query' , $ notifications );
84+ $ this ->assertInstanceOf (Query::class , $ notifications );
8185 $ actual = $ notifications ->enableHydration (false )->toArray ();
8286 $ expected = [];
8387 $ this ->assertEquals ($ actual , $ expected );
0 commit comments