* @license MIT * * @covers \ProxyManager\ProxyGenerator\PropertyGenerator\PublicPropertiesMap * @group Coverage */ class PublicPropertiesMapTest extends PHPUnit_Framework_TestCase { public function testEmptyClass() { $publicProperties = new PublicPropertiesMap(new ReflectionClass('ProxyManagerTestAsset\\EmptyClass')); $this->assertInternalType('array', $publicProperties->getDefaultValue()->getValue()); $this->assertEmpty($publicProperties->getDefaultValue()->getValue()); $this->assertTrue($publicProperties->isStatic()); $this->assertSame('private', $publicProperties->getVisibility()); $this->assertTrue($publicProperties->isEmpty()); } public function testClassWithPublicProperties() { $publicProperties = new PublicPropertiesMap( new ReflectionClass('ProxyManagerTestAsset\\ClassWithPublicProperties') ); $this->assertInternalType('array', $publicProperties->getDefaultValue()->getValue()); $this->assertCount(10, $publicProperties->getDefaultValue()->getValue()); $this->assertTrue($publicProperties->isStatic()); $this->assertSame('private', $publicProperties->getVisibility()); $this->assertFalse($publicProperties->isEmpty()); } }