Permalink
Browse files

fix coding standard, skip Postgres

  • Loading branch information...
sebastienbarre committed Mar 6, 2017
1 parent 3849df0 commit a0e023d3a9396a9def87eb212f7583137623ffca
Showing with 9 additions and 11 deletions.
  1. +9 −11 lib/Cake/Test/Case/Model/CakeSchemaTest.php
@@ -688,6 +688,7 @@ public function testSchemaReadWithCrossDatabase() {
* @return void
*/
public function testSchemaReadWithNonConventionalPrimaryKey() {
$this->skipIf($this->db instanceof Postgres, 'Cannot test on Postgres');
$db = ConnectionManager::getDataSource('test');
$fixture = new NonConventionalPrimaryKeyFixture();
$fixture->create($db);
@@ -699,17 +700,14 @@ public function testSchemaReadWithNonConventionalPrimaryKey() {
));
$fixture->drop($db);
$has_table = isset($read['tables']['non_conventional']);
$this->assertTrue($has_table, 'non_conventional table should appear');
if ($has_table) {
$version_id_has_key = isset($read['tables']['non_conventional']['version_id']['key']);
$this->assertTrue($version_id_has_key, 'version_id key should be set');
if ($version_id_has_key) {
$version_id_key_is_primary = $read['tables']['non_conventional']['version_id']['key'] === 'primary';
$this->assertTrue($version_id_key_is_primary, 'version_id key should be primary');
}
$this->assertFalse(isset($read['tables']['non_conventional']['id']['key']), 'id key should not be set');
}
$hasTable = isset($read['tables']['non_conventional']);
$this->assertTrue($hasTable, 'non_conventional table should appear');
$versionIdHasKey = $hasTable && isset($read['tables']['non_conventional']['version_id']['key']);
$this->assertTrue($versionIdHasKey, 'version_id key should be set');
$versionIdKeyIsPrimary = $versionIdHasKey && $read['tables']['non_conventional']['version_id']['key'] === 'primary';
$this->assertTrue($versionIdKeyIsPrimary, 'version_id key should be primary');
$idHasNoKey = $hasTable && !isset($read['tables']['non_conventional']['id']['key']);
$this->assertTrue($idHasNoKey, 'id key should not be set');
}
/**

0 comments on commit a0e023d

Please sign in to comment.