Files
yii2/tests/framework/db/oci/CommandTest.php
Carsten Brandt 8ba032d147 refactored database tests
- changed test class naming for easier copying and searching of classes
- made base tests abstract and made MySQL an equal citisen in the test
  hierarchie
- added missing db specific test classes
2016-06-20 19:26:43 +02:00

34 lines
824 B
PHP

<?php
namespace yiiunit\framework\db\oci;
use yii\db\Schema;
/**
* @group db
* @group oci
*/
class CommandTest extends \yiiunit\framework\db\CommandTest
{
protected $driverName = 'oci';
public function testAutoQuoting()
{
$db = $this->getConnection(false);
$sql = 'SELECT [[id]], [[t.name]] FROM {{customer}} t';
$command = $db->createCommand($sql);
$this->assertEquals('SELECT "id", "t"."name" FROM "customer" t', $command->sql);
}
public function testLastInsertId()
{
$db = $this->getConnection();
$sql = 'INSERT INTO {{profile}}([[description]]) VALUES (\'non duplicate\')';
$command = $db->createCommand($sql);
$command->execute();
$this->assertEquals(3, $db->getSchema()->getLastInsertID('profile_SEQ'));
}
}