/** * @test */ public function defineAbstractAndUse() { $className = 'ExampleForAbsctuction'; $class = new Stagehand_PHP_Class($className); $class->defineAbstract(); $propertyA = new Stagehand_PHP_Class_Property('a', 10); $methodB = new Stagehand_PHP_Class_Method('b'); $methodB->setCode("return 'foo';"); $methodC = new Stagehand_PHP_Class_Method('c'); $methodC->defineAbstract(); $class->addProperty($propertyA); $class->addMethod($methodB); $class->addMethod($methodC); $class->load(); $refClass = new ReflectionClass($className); $refMethodB = $refClass->getMethod('b'); $refMethodC = $refClass->getMethod('c'); $this->assertTrue($class->isAbstract()); $this->assertTrue($refClass->isAbstract()); $this->assertFalse($refMethodB->isAbstract()); $this->assertTrue($refMethodC->isAbstract()); require_once dirname(__FILE__) . "/ClassTest/ConcreteClass.php"; $instance = new ConcreteClass(); $this->assertEquals($instance->a, 10); $this->assertEquals($instance->b(), 'foo'); $this->assertEquals($instance->c(), 'bar'); }