Exemplo n.º 1
0
 /**
  * @return void
  */
 public function test_function()
 {
     // prepare
     $this->setExpectedException('\\UnexpectedValueException', 'Not initialized');
     // invoke logic & test
     Base::getInstance();
 }
Exemplo n.º 2
0
 /**
  * @return void
  */
 public function test_function()
 {
     // prepare
     Base::init([]);
     $reflection = new \ReflectionClass('\\DbMockLibrary\\Base');
     $staticProperties = $reflection->getStaticProperties();
     // test
     $this->assertInstanceOf('\\DbMockLibrary\\Base', $staticProperties['instance']);
     // invoke logic
     Base::getInstance()->destroy();
     // prepare
     $staticProperties = $reflection->getStaticProperties();
     // test
     $this->assertNull($staticProperties['instance']);
 }