Simplify platform detection test

Since the test is skipped when the driver is not an instance of
`VersionAwarePlatformDriver` we don't need to validate it again.

The message was a bit confusing as well (expected vs given).
parent 52b4692e
......@@ -110,28 +110,28 @@ abstract class AbstractDriverTest extends DbalTestCase
$data = $this->getDatabasePlatformsForVersions();
if (empty($data)) {
$this->fail(
self::assertNotEmpty(
$data,
sprintf(
'No test data found for test %s. You have to return test data from %s.',
get_class($this) . '::' . __FUNCTION__,
get_class($this) . '::getDatabasePlatformsForVersions'
)
);
}
foreach ($data as $item) {
self::assertSame($item[1], get_class($this->driver->createDatabasePlatformForVersion($item[0])),
$generatedVersion = get_class($this->driver->createDatabasePlatformForVersion($item[0]));
self::assertSame(
$item[1],
$generatedVersion,
sprintf(
"Expected platform for version %s should be '%s' %s",
'Expected platform for version "%s" should be "%s", "%s" given',
$item[0],
$item[1],
($this->driver instanceof VersionAwarePlatformDriver
? 'expected: ' . get_class($this->driver->createDatabasePlatformForVersion($item[0]))
: 'see:' . $item[0]
$generatedVersion
)
));
);
}
}
......
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