- $oDB = new \Nominatim\DB('');
- $oDB->connection = $oPDOStub;
- $oDB->tableExists('abc');
+ $oDB = new NominatimSubClassedDB('');
+ $oDB->setConnection($oPDOStub);
+ $oDB->getOne('SELECT name FROM');
+ }
+
+ public function testGetPostgresVersion()
+ {
+ $oDBStub = $this->getMockBuilder(\Nominatim\DB::class)
+ ->disableOriginalConstructor()
+ ->setMethods(array('getOne'))
+ ->getMock();
+
+ $oDBStub->method('getOne')
+ ->willReturn('100006');
+
+ $this->assertEquals(10, $oDBStub->getPostgresVersion());
+ }
+
+ public function testGetPostgisVersion()
+ {
+ $oDBStub = $this->getMockBuilder(\Nominatim\DB::class)
+ ->disableOriginalConstructor()
+ ->setMethods(array('getOne'))
+ ->getMock();
+
+ $oDBStub->method('getOne')
+ ->willReturn('2.4.4');
+
+ $this->assertEquals(2.4, $oDBStub->getPostgisVersion());