* @license MIT * * @covers \ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesDefaults * @group Coverage */ class PublicPropertiesDefaultsTest extends PHPUnit_Framework_TestCase { public function testEmptyClass() { $publicProperties = new PublicPropertiesDefaults(new ReflectionClass('ProxyManagerTestAsset\\EmptyClass')); $this->assertInternalType('array', $publicProperties->getDefaultValue()->getValue()); $this->assertEmpty($publicProperties->getDefaultValue()->getValue()); $this->assertTrue($publicProperties->isStatic()); $this->assertSame(PublicPropertiesDefaults::VISIBILITY_PRIVATE, $publicProperties->getVisibility()); } public function testClassWithPublicProperties() { $publicProperties = new PublicPropertiesDefaults( new ReflectionClass('ProxyManagerTestAsset\\ClassWithPublicProperties') ); $this->assertInternalType('array', $publicProperties->getDefaultValue()->getValue()); $this->assertCount(10, $publicProperties->getDefaultValue()->getValue()); $this->assertTrue($publicProperties->isStatic()); $this->assertSame(PublicPropertiesDefaults::VISIBILITY_PRIVATE, $publicProperties->getVisibility()); } public function testBaseClass() { $publicProperties = new PublicPropertiesDefaults( new ReflectionClass('ProxyManagerTestAsset\\BaseClass') ); $this->assertInternalType('array', $publicProperties->getDefaultValue()->getValue()); $this->assertSame( array('publicProperty' => 'publicPropertyDefault'), $publicProperties->getDefaultValue()->getValue() ); $this->assertTrue($publicProperties->isStatic()); $this->assertSame(PublicPropertiesDefaults::VISIBILITY_PRIVATE, $publicProperties->getVisibility()); } }