Пример #1
0
 /**
  * @group ZF-6444
  */
 public function testPropertyWillLoadFromReflection()
 {
     $reflectionClass = new \Zend\Reflection\ReflectionClass('\\ZendTest\\CodeGenerator\\PHP\\TestAsset\\TestClassWithManyProperties');
     // test property 1
     $reflProp = $reflectionClass->getProperty('_bazProperty');
     $cgProp = PHP\PHPProperty::fromReflection($reflProp);
     $this->assertEquals('_bazProperty', $cgProp->getName());
     $this->assertEquals(array(true, false, true), $cgProp->getDefaultValue()->getValue());
     $this->assertEquals('private', $cgProp->getVisibility());
     $reflProp = $reflectionClass->getProperty('_bazStaticProperty');
     // test property 2
     $cgProp = PHP\PHPProperty::fromReflection($reflProp);
     $this->assertEquals('_bazStaticProperty', $cgProp->getName());
     $this->assertEquals(\ZendTest\CodeGenerator\PHP\TestAsset\TestClassWithManyProperties::FOO, $cgProp->getDefaultValue()->getValue());
     $this->assertTrue($cgProp->isStatic());
     $this->assertEquals('private', $cgProp->getVisibility());
 }