public function testSetter()
 {
     $set = new FixtureSet();
     $set->setLocale('de_DE');
     $set->setSeed(42);
     $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(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());
 }
예제 #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');
     }
 }