mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.1 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\mssql;
 | 
						|
 | 
						|
use yii\db\DefaultValueConstraint;
 | 
						|
use yiiunit\framework\db\AnyValue;
 | 
						|
 | 
						|
/**
 | 
						|
 * @group db
 | 
						|
 * @group mssql
 | 
						|
 */
 | 
						|
class SchemaTest extends \yiiunit\framework\db\SchemaTest
 | 
						|
{
 | 
						|
    public $driverName = 'sqlsrv';
 | 
						|
 | 
						|
    protected $expectedSchemas = [
 | 
						|
        'dbo',
 | 
						|
    ];
 | 
						|
 | 
						|
    public function constraintsProvider()
 | 
						|
    {
 | 
						|
        $result = parent::constraintsProvider();
 | 
						|
        $result['1: check'][2][0]->expression = '([C_check]<>\'\')';
 | 
						|
        $result['1: default'][2] = [];
 | 
						|
        $result['1: default'][2][] = new DefaultValueConstraint([
 | 
						|
            'name' => AnyValue::getInstance(),
 | 
						|
            'columnNames' => ['C_default'],
 | 
						|
            'value' => '((0))',
 | 
						|
        ]);
 | 
						|
 | 
						|
        $result['2: default'][2] = [];
 | 
						|
 | 
						|
        $result['3: foreign key'][2][0]->foreignSchemaName = 'dbo';
 | 
						|
        $result['3: index'][2] = [];
 | 
						|
        $result['3: default'][2] = [];
 | 
						|
 | 
						|
        $result['4: default'][2] = [];
 | 
						|
        return $result;
 | 
						|
    }
 | 
						|
}
 |