2012.5.2
>>>database<<<
1. 修改 protected/config/main.php
去掉mysql数据库连接方式的注释,并且修改用户名,密码以及连接的数据库。
2. 新建 protected/tests/unit/DbTest.php
内容如下:
<?php
class DbTest extends CTestCase
{
public function testConnection()
{
$this->assertNotEquals(NULL, Yii::app()->db);
}
}
3. 执行
C:\xampp\yii\power\protected\tests> phpunit .\unit\DbTest.php
>>>database<<<
1. 修改 protected/config/main.php
去掉mysql数据库连接方式的注释,并且修改用户名,密码以及连接的数据库。
2. 新建 protected/tests/unit/DbTest.php
内容如下:
<?php
class DbTest extends CTestCase
{
public function testConnection()
{
$this->assertNotEquals(NULL, Yii::app()->db);
}
}
3. 执行
C:\xampp\yii\power\protected\tests> phpunit .\unit\DbTest.php
>>>end of datebase<<<