php codecept,Yii2 codecept unit 类找不到
我的測(cè)試代碼如下
1,
'channel_id' => 2,
];
$this->assertTrue(UserSource::recordUserReg($params));
}
}
執(zhí)行的時(shí)候會(huì)抱如下錯(cuò)誤:
Unit Tests (1) --------------------------------------------------------------------------
E UserSourceUintTest: Me
-----------------------------------------------------------------------------------------
Time: 40 ms, Memory: 6.00MB
There was 1 error:
---------
1) UserSourceUintTest: Me
Test tests/unit/UserSourceUintTest.php:testMe
[Error] Class 'app\models\UserSource' not found
#1 UserSourceUintTest->testMe
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
下代碼為我參照官方的
Classical Unit Testing
Unit tests in Codeception are written in absolutely the same way as it is done in PHPUnit:
username = null;
$this->assertFalse($user->validate(['username']));
$user->username = 'toolooooongnaaaaaaameeee';
$this->assertFalse($user->validate(['username']));
$user->username = 'davert';
$this->assertTrue($user->validate(['username']));
}
}
我的問題到底出在哪里?謝謝各位不吝賜教。
回復(fù)內(nèi)容:
我的測(cè)試代碼如下
1,
'channel_id' => 2,
];
$this->assertTrue(UserSource::recordUserReg($params));
}
}
執(zhí)行的時(shí)候會(huì)抱如下錯(cuò)誤:
Unit Tests (1) --------------------------------------------------------------------------
E UserSourceUintTest: Me
-----------------------------------------------------------------------------------------
Time: 40 ms, Memory: 6.00MB
There was 1 error:
---------
1) UserSourceUintTest: Me
Test tests/unit/UserSourceUintTest.php:testMe
[Error] Class 'app\models\UserSource' not found
#1 UserSourceUintTest->testMe
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
下代碼為我參照官方的
Classical Unit Testing
Unit tests in Codeception are written in absolutely the same way as it is done in PHPUnit:
username = null;
$this->assertFalse($user->validate(['username']));
$user->username = 'toolooooongnaaaaaaameeee';
$this->assertFalse($user->validate(['username']));
$user->username = 'davert';
$this->assertTrue($user->validate(['username']));
}
}
我的問題到底出在哪里?謝謝各位不吝賜教。
本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請(qǐng)注明出處,感謝您的尊重!
總結(jié)
以上是生活随笔為你收集整理的php codecept,Yii2 codecept unit 类找不到的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为什么紫薯汤是蓝色的?
- 下一篇: 花椒怎样制作成花椒油