Exemplo n.º 1
0
 public function testSetTargetClass()
 {
     $factory = new BasicUserFactory();
     $template = new Template($factory);
     $template->setTargetClass('\\Fixture\\Carpenter\\User');
     $this->assertAttributeEquals('\\Fixture\\Carpenter\\User', 'targetClass', $template);
 }
Exemplo n.º 2
0
 /**
  * Get a template for building fixtures from the given factory
  *
  * @return Carpenter\Template
  */
 public function getTemplate()
 {
     $template = new Template($this->getNewFactory());
     foreach ($this->getModifiers() as $modifier) {
         $template->addModifier($modifier->name);
     }
     foreach ($this->getDeferreds() as $deferred) {
         $template->addDeferred($deferred->name);
     }
     $template->setTargetClass($this->getTargetClass());
     return $template;
 }