/** * @test */ public function createConstant() { $foo = new Stagehand_PHP_Class_Constant('foo'); $bar = new Stagehand_PHP_Class_Constant('bar', 10); $baz = new Stagehand_PHP_Class_Constant('baz', 'baz'); $this->assertEquals($foo->getName(), 'foo'); $this->assertEquals($bar->getName(), 'bar'); $this->assertEquals($baz->getName(), 'baz'); $this->assertNull($foo->getValue()); $this->assertEquals($bar->getValue(), 10); $this->assertEquals($baz->getValue(), 'baz'); }
/** * Sets a constant. * * @param Stagehand_PHP_Class_Constant $constant */ public function setConstant(Stagehand_PHP_Class_Constant $constant) { $this->_constants[$constant->getName()] = $constant; }