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