Failed with "Catchable fatal error: Object of class
PDO could not be converted to string in".
The message I used was a rather arbitrary choice, but
I think it makes sense.
Bug: T114709
Change-Id: I0023fae3fa2a0c2b37cb3c34751706fe0d481d19
return $endArray;
}
+
+ /**
+ * @return string
+ */
+ public function __toString() {
+ return 'SQLite ' . (string)$this->mConn->getAttribute( PDO::ATTR_SERVER_VERSION );
+ }
+
} // end DatabaseSqlite class
/**
$this->assertTrue( $db->close(), "closing database" );
}
+
+ public function testToString() {
+ $db = DatabaseSqlite::newStandaloneInstance( ':memory:' );
+
+ $toString = (string)$db;
+
+ $this->assertContains( 'SQLite ', $toString );
+ }
}