Skip to content
Permalink
Browse files

Remove conditionals in tests.

These conditionals were required before because the table was left
behind between test runs. When test order was modified tests could fail.
  • Loading branch information...
markstory committed Mar 25, 2016
1 parent e400bc1 commit db6869d33ef3a4a5493aa23cd797acd1d031f4ae
Showing with 13 additions and 12 deletions.
  1. +13 −12 tests/TestCase/TestSuite/TestFixtureTest.php
@@ -281,18 +281,15 @@ public function testInitNoImportNoFieldsException()
public function testInitNoImportNoFields()
{
$db = ConnectionManager::get('test');
$collection = $db->schemaCollection();
if (!in_array('letters', $collection->listTables())) {
$table = new Table('letters', [
'id' => ['type' => 'integer'],
'letter' => ['type' => 'string', 'length' => 1]
]);
$table->addConstraint('primary', ['type' => 'primary', 'columns' => ['id']]);
$sql = $table->createSql($db);
foreach ($sql as $stmt) {
$db->execute($stmt);
}
$table = new Table('letters', [
'id' => ['type' => 'integer'],
'letter' => ['type' => 'string', 'length' => 1]
]);
$table->addConstraint('primary', ['type' => 'primary', 'columns' => ['id']]);
$sql = $table->createSql($db);
foreach ($sql as $stmt) {
$db->execute($stmt);
}
$fixture = new LettersFixture();
@@ -306,6 +303,10 @@ public function testInitNoImportNoFields()
->method('execute');
$this->assertTrue($fixture->create($db));
$this->assertTrue($fixture->drop($db));
// Cleanup.
$db = ConnectionManager::get('test');
$db->execute('DROP TABLE letters');
}
/**

0 comments on commit db6869d

Please sign in to comment.
You can’t perform that action at this time.