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