From d34dbbbb38daa99db467c1ac91f6ca474a88c279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 8 Jan 2023 23:22:53 +0100 Subject: [PATCH] Improved tests for project system --- tests/ApplicationAvailabilityFunctionalTest.php | 5 +++++ tests/Controller/AdminPages/AbstractAdminControllerTest.php | 2 +- .../{DeviceControllerTest.php => ProjectControllerTest.php} | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) rename tests/Controller/AdminPages/{DeviceControllerTest.php => ProjectControllerTest.php} (89%) diff --git a/tests/ApplicationAvailabilityFunctionalTest.php b/tests/ApplicationAvailabilityFunctionalTest.php index b9ab07b1..18fac229 100644 --- a/tests/ApplicationAvailabilityFunctionalTest.php +++ b/tests/ApplicationAvailabilityFunctionalTest.php @@ -126,5 +126,10 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase //Webauthn Register yield ['/webauthn/register']; + + //Projects + yield ['/project/1/info']; + yield ['/project/1/add_parts']; + yield ['/project/1/add_parts?parts=1,2']; } } diff --git a/tests/Controller/AdminPages/AbstractAdminControllerTest.php b/tests/Controller/AdminPages/AbstractAdminControllerTest.php index 47718697..532f0e92 100644 --- a/tests/Controller/AdminPages/AbstractAdminControllerTest.php +++ b/tests/Controller/AdminPages/AbstractAdminControllerTest.php @@ -92,7 +92,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase } //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->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!'); $this->assertSame($read, !$client->getResponse()->isForbidden(), 'Permission Checking not working!'); diff --git a/tests/Controller/AdminPages/DeviceControllerTest.php b/tests/Controller/AdminPages/ProjectControllerTest.php similarity index 89% rename from tests/Controller/AdminPages/DeviceControllerTest.php rename to tests/Controller/AdminPages/ProjectControllerTest.php index be078ebf..586c1b93 100644 --- a/tests/Controller/AdminPages/DeviceControllerTest.php +++ b/tests/Controller/AdminPages/ProjectControllerTest.php @@ -29,8 +29,8 @@ use App\Entity\ProjectSystem\Project; * @group slow * @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; }