diff --git a/lib/conf.d/PhraseaFixture/User/LoadOneUser.php b/lib/conf.d/PhraseaFixture/User/LoadOneUser.php new file mode 100644 index 0000000000..74f34c07cb --- /dev/null +++ b/lib/conf.d/PhraseaFixture/User/LoadOneUser.php @@ -0,0 +1,48 @@ +user) { + throw new \Exception('Please set a user to persist'); + } + + $manager->persist($this->user); + $manager->flush(); + + $this->addReference('one-user', $this->user); + } + + public function getUser() + { + return $this->user; + } + + public function setUser(User $user) + { + $this->user = $user; + } +} diff --git a/tests/Doctrine/Tests/Repositories/UserRepositoryTest.php b/tests/Doctrine/Tests/Repositories/UserRepositoryTest.php index f7a2f68a01..979209b0b9 100644 --- a/tests/Doctrine/Tests/Repositories/UserRepositoryTest.php +++ b/tests/Doctrine/Tests/Repositories/UserRepositoryTest.php @@ -101,4 +101,4 @@ class UserRepositoryTest extends \PhraseanetPHPUnitAbstract $userFound = self::$DI['app']['EM']->getRepository('Entities\User')->findByEmail(null); $this->assertNull($userFound); } -} \ No newline at end of file +} diff --git a/tests/classes/PhraseanetPHPUnitAbstract.php b/tests/classes/PhraseanetPHPUnitAbstract.php index b691b7ec34..f9584a4a84 100644 --- a/tests/classes/PhraseanetPHPUnitAbstract.php +++ b/tests/classes/PhraseanetPHPUnitAbstract.php @@ -581,7 +581,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $this->insertFixtureInDatabase($loader); } catch (\Exception $e) { - $this->fail('Fail load one Basket : ' . $e->getMessage()); + $this->fail('Fail load one User : ' . $e->getMessage()); } } diff --git a/tests/db-ref.sqlite b/tests/db-ref.sqlite index cec8f4cef0..00327d6e65 100644 Binary files a/tests/db-ref.sqlite and b/tests/db-ref.sqlite differ