From 7d2ce923176de2f6937b7e888317edc7dd5734ba Mon Sep 17 00:00:00 2001 From: apetitpa Date: Wed, 15 Mar 2017 11:14:00 +0100 Subject: [PATCH] #504 Move FixturesTrait class from Tests to AppBundle namespace Moved the FixturesTrait class to the AppBundle namespace in attempt to fix the heroku deployment failure. This class is needed not only in dev or test environments but also in production because the database is loaded using the doctrine fixtures bundle. --- {tests => src/AppBundle/DataFixtures}/FixturesTrait.php | 2 +- src/AppBundle/DataFixtures/ORM/PostFixtures.php | 2 +- src/AppBundle/DataFixtures/ORM/TagFixtures.php | 2 +- tests/AppBundle/Controller/Admin/BlogControllerTest.php | 2 +- tests/AppBundle/Controller/BlogControllerTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename {tests => src/AppBundle/DataFixtures}/FixturesTrait.php (99%) diff --git a/tests/FixturesTrait.php b/src/AppBundle/DataFixtures/FixturesTrait.php similarity index 99% rename from tests/FixturesTrait.php rename to src/AppBundle/DataFixtures/FixturesTrait.php index 0f1bbdc8a..cb5a401ec 100644 --- a/tests/FixturesTrait.php +++ b/src/AppBundle/DataFixtures/FixturesTrait.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Tests; +namespace AppBundle\DataFixtures; /** * Helper class to create fixtures contents. diff --git a/src/AppBundle/DataFixtures/ORM/PostFixtures.php b/src/AppBundle/DataFixtures/ORM/PostFixtures.php index c7d7d9d41..1a7e17518 100644 --- a/src/AppBundle/DataFixtures/ORM/PostFixtures.php +++ b/src/AppBundle/DataFixtures/ORM/PostFixtures.php @@ -11,6 +11,7 @@ namespace AppBundle\DataFixtures\ORM; +use AppBundle\DataFixtures\FixturesTrait; use AppBundle\Entity\Comment; use AppBundle\Entity\Post; use Doctrine\Common\DataFixtures\AbstractFixture; @@ -18,7 +19,6 @@ use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; -use Tests\FixturesTrait; /** * Defines the sample blog posts to load in the database before running the unit diff --git a/src/AppBundle/DataFixtures/ORM/TagFixtures.php b/src/AppBundle/DataFixtures/ORM/TagFixtures.php index 4052e051f..a99bbffc0 100644 --- a/src/AppBundle/DataFixtures/ORM/TagFixtures.php +++ b/src/AppBundle/DataFixtures/ORM/TagFixtures.php @@ -11,10 +11,10 @@ namespace AppBundle\DataFixtures\ORM; +use AppBundle\DataFixtures\FixturesTrait; use AppBundle\Entity\Tag; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\Persistence\ObjectManager; -use Tests\FixturesTrait; /** * Defines the sample blog tags to load in the database before running the unit diff --git a/tests/AppBundle/Controller/Admin/BlogControllerTest.php b/tests/AppBundle/Controller/Admin/BlogControllerTest.php index a5093b96e..c60ec8a48 100644 --- a/tests/AppBundle/Controller/Admin/BlogControllerTest.php +++ b/tests/AppBundle/Controller/Admin/BlogControllerTest.php @@ -11,11 +11,11 @@ namespace Tests\AppBundle\Controller\Admin; +use AppBundle\DataFixtures\FixturesTrait; use AppBundle\Entity\Post; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\HttpFoundation\Response; use Tests\ControllerTestTrait; -use Tests\FixturesTrait; /** * Functional test for the controllers defined inside the BlogController used diff --git a/tests/AppBundle/Controller/BlogControllerTest.php b/tests/AppBundle/Controller/BlogControllerTest.php index 31c95a9fe..ebcfd0e57 100644 --- a/tests/AppBundle/Controller/BlogControllerTest.php +++ b/tests/AppBundle/Controller/BlogControllerTest.php @@ -11,11 +11,11 @@ namespace Tests\AppBundle\Controller; +use AppBundle\DataFixtures\FixturesTrait; use AppBundle\Entity\Post; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\HttpFoundation\Response; use Tests\ControllerTestTrait; -use Tests\FixturesTrait; /** * Functional test for the controllers defined inside BlogController.