Permalink
Browse files

Fixed tests.

  • Loading branch information...
1 parent b95e032 commit 55de5dc0250857bafc3e08fb464d7c09ba68a76d qiang.xue committed Nov 12, 2010
@@ -28,6 +28,6 @@ protected function extractDefault($defaultValue)
if($this->type==='string') // PHP 5.2.6 adds single quotes while 5.2.0 doesn't
$this->defaultValue=trim($defaultValue,"'\"");
else
- $this->defaultValue=$this->typecast($defaultValue);
+ $this->defaultValue=$this->typecast(strcasecmp($defaultValue,'null') ? $defaultValue : null);
}
}
@@ -13,7 +13,7 @@ public function setUp()
if(!extension_loaded('pdo') || !extension_loaded('pdo_pgsql'))
$this->markTestSkipped('PDO and PostgreSQL extensions are required.');
- $this->db=new CDbConnection('pgsql:host=localhost;dbname=yii','test','test');
+ $this->db=new CDbConnection('pgsql:host=127.0.0.1;dbname=yii','test','test');
try
{
$this->db->active=true;
@@ -40,7 +40,7 @@ public function setUp()
'components'=>array(
'db'=>array(
'class'=>'system.db.CDbConnection',
- 'connectionString'=>'pgsql:host=localhost;dbname=yii',
+ 'connectionString'=>'pgsql:host=127.0.0.1;dbname=yii',
'username'=>'test',
'password'=>'test',
),
@@ -490,7 +490,7 @@ function testAddBetweenCondition(){
}
function testToArray(){
- $keys = array('select', 'condition', 'params', 'limit', 'offset', 'order', 'group', 'join', 'having', 'distinct', 'with', 'alias', 'together');
+ $keys = array('select', 'condition', 'params', 'limit', 'offset', 'order', 'group', 'join', 'having', 'distinct', 'with', 'alias', 'index', 'together');
$criteria = new CDbCriteria();
$this->assertEquals($keys, array_keys($criteria->toArray()));
}
@@ -13,7 +13,7 @@ public function setUp()
if(!extension_loaded('pdo') || !extension_loaded('pdo_mysql'))
$this->markTestSkipped('PDO and MySQL extensions are required.');
- $this->db=new CDbConnection('mysql:host=localhost;dbname=yii','test','test');
+ $this->db=new CDbConnection('mysql:host=127.0.0.1;dbname=yii','test','test');
$this->db->charset='UTF8';
try
{
@@ -11,7 +11,7 @@ public function setUp()
if(!extension_loaded('pdo') || !extension_loaded('pdo_pgsql'))
$this->markTestSkipped('PDO and PostgreSQL extensions are required.');
- $this->db=new CDbConnection('pgsql:host=localhost;dbname=yii','test','test');
+ $this->db=new CDbConnection('pgsql:host=127.0.0.1;dbname=yii','test','test');
$this->db->charset='UTF8';
try
{

0 comments on commit 55de5dc

Please sign in to comment.