コード例 #1
0
 public function testAddDeferred()
 {
     $factory = new ModifierUserFactory();
     $template = new Template($factory);
     $template->addDeferred('password');
     $this->assertAttributeContains('password', 'deferreds', $template);
 }
コード例 #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;
 }