/** * Tests the JApplicationWeb::getInstance method. * * @return void * * @since 11.3 */ public function testGetInstance() { $this->assertInstanceOf('JApplicationWebInspector', JApplicationWeb::getInstance('JApplicationWebInspector'), 'Tests that getInstance will instantiate a valid child class of JApplicationWeb.'); $this->inspector->setClassInstance('foo'); $this->assertThat(JApplicationWeb::getInstance('JApplicationWebInspector'), $this->equalTo('foo'), 'Tests that singleton value is returned.'); $this->inspector->setClassInstance(null); $this->assertInstanceOf('JApplicationWeb', JApplicationWeb::getInstance('Foo'), 'Tests that getInstance will instantiate a valid child class of JApplicationWeb given a non-existent type.'); }