Skip to content

Commit

Permalink
Fixed upsert test with firebird < 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Apr 3, 2018
1 parent 26e9703 commit 49af115
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/CommandTest.php
Expand Up @@ -14,7 +14,7 @@ class CommandTest extends \yiiunit\framework\db\CommandTest
use FirebirdTestTrait;

public $driverName = 'firebird';

public function testAutoQuoting()
{
$db = $this->getConnection(false);
Expand Down Expand Up @@ -313,12 +313,27 @@ public function batchInsertSqlProvider() {

return $data;
}

public function testCreateView() {
$db = $this->getConnection(false);
if ($db->getSchema()->getTableSchema('testCreateView') !== null) {
$db->createCommand()->dropView('testCreateView')->execute();
}
parent::testCreateView();
}

/**
* @dataProvider upsertProvider
* @param array $firstData
* @param array $secondData
*/
public function testUpsert(array $firstData, array $secondData)
{
$db = $this->getConnection(false);
if ($firstData['params'][1] instanceof \yii\db\Query && version_compare($db->firebird_version, '3.0.0', '<')) {
$this->setExpectedException('\yii\base\NotSupportedException', 'Firebird < 3.0.0 has the "Unstable Cursor" problem');
}
parent::testUpsert($firstData, $secondData);
}

}

0 comments on commit 49af115

Please sign in to comment.