我尝试使用中提到的phpunit来运行mongdodb的驱动程序测试,但是MongoInt32Test.php文件似乎有问题。
# phpunit tests/mongosuite.php
Warning: require_once(MongoInt32Test.php): failed to open stream: No such file or directory in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
Fatal error: require
我已经配置了所有内容,但是当我运行测试时,它失败了,并显示以下错误日志:
/usr/bin/php /tmp/ide-phpunit.php --bootstrap /home/lchost/EOSS2/tests/bootstrap.php --no-configuration /home/lchost/EOSS2/tests
Testing started at 9:02 PM ...
PHP Notice: Undefined variable: argv in /tmp/ide-phpunit.php(191) : eval()'d code on line 1
PHP St
我正在使用进行单元测试,它运行得很好。
AppCategoryControllerTest.php:
class AppCategoryControllerTest extends BoEditoAuthWebTestCase
{
public function setUp()
{
parent::setUp();
// It returns an array of class paths
$this->loadFixtures($this->getAllDataFixtures());
}
//..
我在下面有一个测试类,我只想运行其中的一个测试,例如"aboutPage“。你知道怎么做吗?
这就是我只运行这个文件的方式:
codecept run tests/acceptance/VisitorCest.php
但现在我只想从文件中运行一个测试。
<?php
use \AcceptanceTester;
class VisitorCest
{
public function _before(){}
public function _after(){}
public function aboutPage(AcceptanceTester $I)
注:这不是一个重复的问题。我见过一些类似的问题,但我问的是单元测试。
我试图使用CakePHP 2.3.6编写测试用例,并在使用header()函数的测试用例中遇到问题。测试在浏览器上运行时没有问题,但在命令行中,我得到了以下错误。
Cannot modify header information - headers already sent by (output started at /usr/share/pear/PHPUnit/Util/Printer.php:172)
例如,错误发生在我的代码的下面一行。
header( 'Content-Type: application/j