/** * @test * @covers SlimApp\Db\DbTable::getConnection * @uses SlimApp\HasRequiredParamsTrait */ public function getConnection_sets_connection_if_connection_was_not_set() { $config = (require __DIR__ . '/database-config-for-dbunit.php'); $table = $this->getMockBuilder('SlimApp\\Db\\DbTable')->getMockForAbstractClass(); $dbTable = new \SebastianBergmann\PeekAndPoke\Proxy($table); $dbTable->setConfig($config); $dbAdapter = $dbTable->getConnection(); $this->assertInstanceOf('\\PDO', $dbAdapter); }