mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-08 08:17:24 +01:00
* Add github action for testing oci8 Oracle. * Fix CommandTest::testQueryCache. * Fix tests CommandTest::testBindParamsNonWhere. * Fix test CommandTest::testInsert. * Fix test CommanTest::testInsertExpression. * Fix test CommandTest::testInsertSelectAlias. * Fix test CommandTest::testBindParamValue. * Fix tests CommandTest::testBatchInsertDataTypesLocale. * Fix test CommandTest::testNoTablenameReplacement. * Fix test CommandTest::testCreateTable. * Fix test CommandTest::testsInsertQueryAsColumnValue. * Fix tests CommandTest::testAlterTable. * Fix test CommandTest::testCreateView. * Fix test CommandTest::testTransaction. * Fix test ConnectionTest::testTransactionShortcutCorrect. * Fix test ConnectionTest::testTransactionShortcutCustom. * Fix test ConnectionTest::testEnableQueryLog. * Fix test QueryBuilder::testAddDropDefaultValue. * Fix test QueryTest::testUnion. * Fix test QueryTest::testExpressionInFrom. * Fix test SchemaTest::testFindUniqueIndexes. * Fix test QueryBuilderTest::testGetColumnType. * Fix test ActiveRecordTest::testFind. * Fix test ExistValidatorTest::testExpresionInAttributeColumnName. * Fix test UniqueValidatorTest::testExpressionInAttributeColumnName. * Fix ActiveRecordTest testCastValues(), testDefaultValues. * Fix test UniqueValidatorTest::testValidateAttributeDefault. * Fix test UniqueValidatorTest::testValidateEmptyAttributeInStringField. * Fix test UniqueValidatorTest::testValidateEmptyAttributeInIntField. * Fix test ActiveRecordTest::testBit. * Fix test ActiveRecordTest::testBooleanAttribute. * Fix test ActiveRecordTest::testJoinWithAlias. * Fix test SchemaTest::testColumnSchema. * Fix test CommandTest:: testBatchInsertSQL. * Skip CommandTest::testColumnCase. * Fix test ConnectionTest::testQuoteValue. * Should be fixed tests conditionsProvider in QueryBuilderTest. * Fix ActiveRecordTest.php * Fix test UniqueValidatorTest. * Fix test QueryBuilderTest::testUpsert. * Skip SchemaTest::testCompositeFK.
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* @link http://www.yiiframework.com/
|
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
|
* @license http://www.yiiframework.com/license/
|
|
*/
|
|
|
|
namespace yiiunit\framework\db\oci;
|
|
|
|
use yii\validators\UniqueValidator;
|
|
use yiiunit\data\validators\models\ValidatorTestMainModel;
|
|
use yiiunit\data\validators\models\ValidatorTestRefModel;
|
|
|
|
/**
|
|
* @group db
|
|
* @group oci
|
|
* @group validators
|
|
*/
|
|
class UniqueValidatorTest extends \yiiunit\framework\validators\UniqueValidatorTest
|
|
{
|
|
public $driverName = 'oci';
|
|
|
|
public function testValidateEmptyAttributeInStringField()
|
|
{
|
|
ValidatorTestMainModel::deleteAll();
|
|
|
|
$val = new UniqueValidator();
|
|
|
|
$m = new ValidatorTestMainModel(['id' => 5, 'field1' => ' ']);
|
|
|
|
$val->validateAttribute($m, 'field1');
|
|
$this->assertFalse($m->hasErrors('field1'));
|
|
$m->save(false);
|
|
|
|
$m = new ValidatorTestMainModel(['field1' => ' ']);
|
|
$val->validateAttribute($m, 'field1');
|
|
$this->assertTrue($m->hasErrors('field1'));
|
|
}
|
|
}
|