public function testGetTemplate()
 {
     $reflection = new ReflectionClass('\\Fixture\\Carpenter\\ComprehensiveUserFactory');
     $parser = new FactoryParser($reflection);
     $template = $parser->getTemplate();
     $this->assertInstanceOf('\\Carpenter\\Template', $template);
     $this->assertAttributeInstanceOf('\\Fixture\\Carpenter\\ComprehensiveUserFactory', 'factory', $template);
     $this->assertAttributeContains('salt', 'deferreds', $template);
     $this->assertAttributeContains('deleted', 'modifiers', $template);
     $this->assertAttributeEquals('\\Fixture\\Carpenter\\User', 'targetClass', $template);
 }
Ejemplo n.º 2
0
 /**
  * Parses the factory class and gets a template for building fixtures
  *
  * @param string $class The factory class
  * @return Carpenter\Template
  */
 private static function buildTemplate($class)
 {
     $reflection = new ReflectionClass($class);
     $parser = new FactoryParser($reflection);
     return $parser->getTemplate();
 }