Yii2 framework backup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
845 B

<?php
namespace yiiunit\framework\db\oci;
use yii\db\Schema;
use yiiunit\framework\db\CommandTest;
/**
* @group db
* @group oci
*/
class OracleCommandTest extends 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'));
}
}