Improved tests for project system

This commit is contained in:
Jan Böhmer 2023-01-08 23:22:53 +01:00
parent de4c25ac0e
commit d34dbbbb38
3 changed files with 8 additions and 3 deletions

View file

@ -126,5 +126,10 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase
//Webauthn Register //Webauthn Register
yield ['/webauthn/register']; yield ['/webauthn/register'];
//Projects
yield ['/project/1/info'];
yield ['/project/1/add_parts'];
yield ['/project/1/add_parts?parts=1,2'];
} }
} }

View file

@ -92,7 +92,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
} }
//Test read/list access by access /new overview page //Test read/list access by access /new overview page
$client->request('GET', static::$base_path.'/1'); $client->request('GET', static::$base_path.'/1/edit');
$this->assertFalse($client->getResponse()->isRedirect()); $this->assertFalse($client->getResponse()->isRedirect());
$this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); $this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
$this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!');

View file

@ -29,8 +29,8 @@ use App\Entity\ProjectSystem\Project;
* @group slow * @group slow
* @group DB * @group DB
*/ */
class DeviceControllerTest extends AbstractAdminControllerTest class ProjectControllerTest extends AbstractAdminControllerTest
{ {
protected static $base_path = '/en'.'/device'; protected static $base_path = '/en'.'/project';
protected static $entity_class = Project::class; protected static $entity_class = Project::class;
} }