Ejemplo n.º 1
0
 public function setUp()
 {
     $fakeHandler = new FakeHandler\FakeHandler();
     $fakeHandler->setSuccessor(new FakeHandler\CustomFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\DefaultFakerClass());
     $this->faker = new FakeDataFactory($fakeHandler, new DoctrineLayer(), new TwigTemplate());
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     $this->conf['fake'] = array('fake1' => array('Name' => array('length' => 3), 'Surname' => null), 'fake2' => array('Name' => array('length' => 30), 'Surname' => null), 'fake3' => array('fake1', 'fake2'));
     FakerinoConf::loadConfiguration($this->conf);
     $fakeHandler = new FakeHandler\FakeHandler();
     $fakeHandler->setSuccessor(new FakeHandler\FileFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\CustomFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\ConfFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\DefaultFakerClass());
     $this->fakeGenerator = new FakeDataFactory($fakeHandler, new DoctrineLayer(), new TwigTemplate());
 }
Ejemplo n.º 3
0
 public function setUp()
 {
     $this->num = 3;
     $this->testTable = 'testTable';
     $this->connectionParams = array('user' => null, 'password' => null, 'memory' => true, 'driver' => 'pdo_sqlite');
     $fakeHandler = new FakeHandler\FakeHandler();
     $fakeHandler->setSuccessor(new FakeHandler\CustomFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\DefaultFakerClass());
     $faker = new FakeDataFactory($fakeHandler, new DoctrineLayer(), new TwigTemplate());
     $this->mockDoctrineLayer = $this->getMockBuilder('Fakerino\\Core\\Database\\DoctrineLayer')->getMock();
     $this->dbFiller = new DbFiller($this->connectionParams, $this->mockDoctrineLayer, $this->testTable, $faker, $this->num);
 }
Ejemplo n.º 4
0
 private static function getDefaultHandler()
 {
     $filePath = self::getDefaultFakefilePath();
     $fakerinoTag = self::getDefaultFakerinoTag();
     $fakeHandler = new FakeHandler\FakeHandler();
     $fakeHandler->setSuccessor(new FakeHandler\FileFakerClass($filePath));
     $fakeHandler->setSuccessor(new FakeHandler\CustomFakerClass());
     $fakeHandler->setSuccessor(new FakeHandler\ConfFakerClass($fakerinoTag));
     $fakeHandler->setSuccessor(new FakeHandler\RegExFakerClass(new RegRevGenerator()));
     $fakeHandler->setSuccessor(new FakeHandler\DefaultFakerClass());
     return $fakeHandler;
 }