Update SQLite database reference

This commit is contained in:
Nicolas Le Goff
2013-08-27 00:21:58 +02:00
parent 6969fb6a7c
commit 33b0648ce5
4 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PhraseaFixture\User;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use Entities\User;
class LoadOneUser extends AbstractFixture implements FixtureInterface
{
/**
*
* @var User
*/
public $user;
public function load(ObjectManager $manager)
{
if (null === $this->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;
}
}

View File

@@ -581,7 +581,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
$this->insertFixtureInDatabase($loader); $this->insertFixtureInDatabase($loader);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->fail('Fail load one Basket : ' . $e->getMessage()); $this->fail('Fail load one User : ' . $e->getMessage());
} }
} }

Binary file not shown.