From 73b5914baaf724538ce0122445f9ee17f4229320 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 5 Mar 2025 10:34:02 +0100 Subject: [PATCH] Updated test --- config/services_test.yaml | 3 +++ phpunit.xml.dist | 10 ++++++++-- tests/Functional/ClientTest.php | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 config/services_test.yaml diff --git a/config/services_test.yaml b/config/services_test.yaml new file mode 100644 index 0000000..183a1d8 --- /dev/null +++ b/config/services_test.yaml @@ -0,0 +1,3 @@ +services: + App\EventListener\ClientStatusNotifier: + tags: ~ # Esto elimina el listener en el entorno de test \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd0dd75..7b99837 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,8 @@ + + - tests + tests @@ -28,6 +30,10 @@ + + + + diff --git a/tests/Functional/ClientTest.php b/tests/Functional/ClientTest.php index 82d8055..c09b047 100644 --- a/tests/Functional/ClientTest.php +++ b/tests/Functional/ClientTest.php @@ -42,7 +42,9 @@ class ClientTest extends AbstractTest { UserFactory::createOne(['username' => self::USER_ADMIN, 'roles'=> [UserGroupPermissions::ROLE_SUPER_ADMIN]]); - ClientFactory::createMany(10); + $ou = OrganizationalUnitFactory::new(['type' => OrganizationalUnitTypes::ORGANIZATIONAL_UNIT])->create()->_disableAutoRefresh(); + $ou->_save(); + ClientFactory::createOne(['organizationalUnit' => $ou]); $this->createClientWithCredentials()->request('GET', '/clients'); $this->assertResponseStatusCodeSame(Response::HTTP_OK); @@ -51,7 +53,7 @@ class ClientTest extends AbstractTest '@context' => '/contexts/Client', '@id' => '/clients', '@type' => 'hydra:Collection', - 'hydra:totalItems' => 10, + 'hydra:totalItems' => 1, ]); }