Commit 44ab7bcd authored by Steve Müller's avatar Steve Müller

fix test for Travis

parent f7bf60a4
...@@ -32,9 +32,21 @@ class DriverTest extends AbstractDriverTest ...@@ -32,9 +32,21 @@ class DriverTest extends AbstractDriverTest
$password = isset($parameters['password']) ? $parameters['password'] : null; $password = isset($parameters['password']) ? $parameters['password'] : null;
$connection = $this->driver->connect($parameters, $user, $password); $connection = $this->driver->connect($parameters, $user, $password);
$statement = $connection->query('SELECT application_name FROM pg_stat_activity');
$this->assertSame('doctrine', $statement->fetchColumn()); $hash = microtime(true); // required to identify the record in the results uniquely
$sql = sprintf('SELECT query, application_name FROM pg_stat_activity WHERE %d = %d', $hash, $hash);
$statement = $connection->query($sql);
$records = $statement->fetchAll();
foreach ($records as $record) {
if ($record['query'] === $sql) {
$this->assertSame('doctrine', $record['application_name']);
return;
}
}
$this->fail(sprintf('Query result does not contain a record where column "query" equals "%s".', $sql));
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment