Esempio n. 1
0
 public function create()
 {
     $definition = new Definition($this->className);
     $definition->setClass($this->nameSpace . '\\' . $this->className);
     $definition->setAbstract(true);
     $properties = $this->extractProperties();
     $definition->setProperties($properties);
     $methods = $this->extractMethods();
     $definition->setMethods($methods);
     $definition->addInterface('\\Serializable');
     $definition->addMethod($this->createSerialize());
     $definition->addMethod($this->createUnserialize());
     return $definition;
 }
Esempio n. 2
0
 public function testDocComment()
 {
     $definition = new Definition('Class1');
     $definition->setDocComment('myDoc');
     $this->assertSame('myDoc', $definition->getDocComment());
 }
Esempio n. 3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testRemoveConstantBynameShouldThrowException()
 {
     $definition = new Definition('Class1');
     $definition->removeConstantByName('X');
 }
Esempio n. 4
0
 /**
  * Constructor.
  *
  * @param string                   $class  The class.
  * @param Mandango\Mondator\Output $output The output.
  *
  * @api
  */
 public function __construct($class, Output $output)
 {
     parent::__construct($class);
     $this->setOutput($output);
 }