actions gitea and github + more tests

This commit is contained in:
2025-11-18 00:52:28 -08:00
parent 5dc7aa87cd
commit 639f7bbe27
4 changed files with 282 additions and 168 deletions

View File

@@ -41,8 +41,7 @@ class CitiesControllerTest extends BaseControllerTest
protected function setUp(): void
{
parent::setUp();
$this->Cities = $this->getTableLocator()->get('Cities');
$this->enableCsrfToken();
$this->Cities = $this->getTableLocator()->get('CakeAddresses.Cities');
}
/**
@@ -57,28 +56,6 @@ class CitiesControllerTest extends BaseControllerTest
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
*
@@ -89,9 +66,8 @@ class CitiesControllerTest extends BaseControllerTest
*
* @return void
*/
public function testSelectGetLoggedIn(): void
public function testSelect(): void
{
$this->loginUserByRole();
$url = [
'plugin' => 'CakeAddresses',
'controller' => 'Cities',