Returns the value with the passed key from the initial context.
public getAttribute ( string $key ) : mixed | ||
$key | string | The key of the value to return |
return | mixed | The value stored in the initial context |
/** * Tests the if the attribute getter/setter works with a object. * * @return void */ public function testGetSetAttributeWithObject() { $stdClass = new \stdClass(); $stdClass->test = 'Testvalue'; $this->initialContext->setAttribute('stdClass', $stdClass); $this->assertEquals($stdClass->test, $this->initialContext->getAttribute('stdClass')->test); }