*/ protected array $fixtures = [ // 'plugin.CakeAddresses.Regions', // 'plugin.CakeAddresses.Subregions', 'plugin.CakeAddresses.Countries', 'plugin.CakeAddresses.States', 'plugin.CakeAddresses.Cities', ]; /** * setUp method * * @return void */ protected function setUp(): void { parent::setUp(); $this->Cities = $this->getTableLocator()->get('Cities'); $this->enableCsrfToken(); } /** * tearDown method * * @return void */ protected function tearDown(): void { unset($this->Cities); parent::tearDown(); } /** * Test select method * * Tests the select action with an unauthenticated user (not logged in) * * @uses \CakeAddresses\Controller\CitiesController::select() * @throws Exception * * @return void */ public function testSelectGetUnauthenticated(): void { $url = [ 'plugin' => 'CakeAddresses', 'controller' => 'Cities', 'action' => 'select', ]; $this->get($url); $this->assertResponseCode(302); $this->assertRedirectContains('login'); } /** * Test select method * * Tests the select action with a logged in user * * @uses \CakeAddresses\Controller\CitiesController::select() * @throws Exception * * @return void */ public function testSelectGetLoggedIn(): void { $this->loginUserByRole(); $url = [ 'plugin' => 'CakeAddresses', 'controller' => 'Cities', 'action' => 'select', ]; $this->get($url); $this->assertResponseCode(200); } }