Exemplo n.º 1
0
 public function load()
 {
     $set = new FixtureSet(['do_drop' => true, 'do_persist' => true]);
     foreach ((new Finder())->files()->in(__DIR__ . '/../Resources/fixtures')->name('*.yml') as $file) {
         $set->addFile($file, 'yaml');
     }
     $this->manager->load($set);
 }
Exemplo n.º 2
0
 /**
  * Initializes the seed for random numbers, given by a fixture set.
  */
 protected function initSeedFromSet(FixtureSet $set)
 {
     if (is_numeric($set->getSeed())) {
         mt_srand($set->getSeed());
         $this->logDebug('Initialized with seed ' . $set->getSeed());
     } else {
         mt_srand();
         $this->logDebug('Initialized with random seed');
     }
 }
Exemplo n.º 3
0
 public function testSetter()
 {
     $set = new FixtureSet();
     $set->setLocale('de_DE');
     $set->setSeed(42);
     $set->setOrder(1337);
     $set->setDoDrop(true);
     $set->setDoPersist(false);
     $set->addFile('/foo', 'bar');
     $set->addFile('/bob', 'xyz');
     $this->assertEquals('de_DE', $set->getLocale());
     $this->assertEquals(42, $set->getSeed());
     $this->assertEquals(1337, $set->getOrder());
     $this->assertEquals(true, $set->getDoDrop());
     $this->assertEquals(false, $set->getDoPersist());
     $this->assertEquals(array(0 => array('type' => "bar", 'path' => "/foo"), 1 => array('type' => "xyz", 'path' => "/bob")), $set->getFiles());
 }
Exemplo n.º 4
0
<?php

use h4cc\AliceFixturesBundle\Fixtures\FixtureSet;
$set = new FixtureSet(array('locale' => 'es_ES', 'do_drop' => true, 'do_persist' => true));
$set->addFile(__DIR__ . '/university.yml', 'yaml');
$set->addFile(__DIR__ . '/colleges.yml', 'yaml');
$set->addFile(__DIR__ . '/academicdegree.yml', 'yaml');
$set->addFile(__DIR__ . '/studentdelegation.yml', 'yaml');
$set->addFile(__DIR__ . '/users.yml', 'yaml');
$set->addFile(__DIR__ . '/conventions.yml', 'yaml');
$set->addFile(__DIR__ . '/tickets.yml', 'yaml');
return $set;
Exemplo n.º 5
0
<?php

use h4cc\AliceFixturesBundle\Fixtures\FixtureSet;
$set = new FixtureSet(array('do_drop' => true, 'do_persist' => true));
$set->addFile(__DIR__ . '/topic.yml', 'yaml');
$set->addFile(__DIR__ . '/users.yml', 'yaml');
$set->addFile(__DIR__ . '/conferences.yml', 'yaml');
$set->addFile(__DIR__ . '/inscription.yml', 'yaml');
$set->addFile(__DIR__ . '/articles.yml', 'yaml');
$set->addFile(__DIR__ . '/author.yml', 'yaml');
$set->addFile(__DIR__ . '/articlesReview.yml', 'yaml');
$set->addFile(__DIR__ . '/reviewer.yml', 'yaml');
$set->addFile(__DIR__ . '/reviewComments.yml', 'yaml');
return $set;
Exemplo n.º 6
0
<?php

use h4cc\AliceFixturesBundle\Fixtures\FixtureSet;
$set = new FixtureSet(array('locale' => 'es_ES', 'do_drop' => true, 'do_persist' => true));
$set->addFile(__DIR__ . '/users.yml', 'yaml');
$set->addFile(__DIR__ . '/company.yml', 'yaml');
$set->addFile(__DIR__ . '/trademark.yml', 'yaml');
$set->addFile(__DIR__ . '/tableLogisticVariables.yml', 'yaml');
$set->addFile(__DIR__ . '/barcode.yml', 'yaml');
$set->addFile(__DIR__ . '/product.yml', 'yaml');
return $set;