Skip to content

Commit

Permalink
fix coding standard, skip Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienbarre committed Mar 6, 2017
1 parent 3849df0 commit a0e023d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/Cake/Test/Case/Model/CakeSchemaTest.php
Expand Up @@ -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);
Expand All @@ -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');
}

/**
Expand Down

0 comments on commit a0e023d

Please sign in to comment.