/** * Tests the getState method. * * @since 12.3 * * @return void */ public function testGetState() { $state = $this->fixture->getState(); $this->assertTrue($state instanceof JObject); $stateSet = TestReflection::getValue($this->fixture, '__state_set'); $this->assertTrue($stateSet === true); $this->fixture->setState('foo.bar', 'baz'); $this->assertEquals('baz', $this->fixture->getState('foo.bar')); $this->assertEquals('defaultVal', $this->fixture->getState('non.existent', 'defaultVal')); $this->assertNull($this->fixture->getState('non.existent')); }
/** *Tests the getState method. * * @since 12.3 * * @return void * * @testdox getState() returns correct value */ public function testGetStateReturnsCorrectValue() { $this->fixture->setState('foo.bar', 'baz'); $this->assertEquals('baz', $this->fixture->getState('foo.bar')); }