/** * @return void */ public function test_function() { // prepare $this->setExpectedException('\\UnexpectedValueException', 'Not initialized'); // invoke logic & test Base::getInstance(); }
/** * @return void */ public function test_function() { // prepare $this->setExpectedException('\\DbMockLibrary\\Exceptions\\AlreadyInitializedException', 'DbMockLibrary\\Base has already been initialized'); // invoke logic Base::init([]); Base::init([]); }
/** * @return void */ public function test_function() { // invoke logic Base::init(); // prepare $reflection = new \ReflectionClass('\\DbMockLibrary\\Base'); $staticProperties = $reflection->getStaticProperties(); // test $this->assertInstanceOf('\\DbMockLibrary\\Base', $staticProperties['instance']); }