D
D
Dmitry Baibukhtin2014-09-28 21:51:26
Yii
Dmitry Baibukhtin, 2014-09-28 21:51:26

Testing in Yii 2. Why such an error?

Hello, please tell me why when running a test on Yii 2 there is such an error, PHPUnit and Codeception are installed.

"C:\Program Files\OpenServer\modules\php\PHP-5.5\php.exe" C:\Users\Обычная\AppData\Local\Temp\ide-phpunit.php --no-configuration backend\tests\unit\ExampleTest "C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\backend\tests\unit\ExampleTest.php"
Testing started at 21:50 ...
PHPUnit 4.2.6 by Sebastian Bergmann.


Fatal error: Call to a member function run() on a non-object in C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\codeception\codeception\src\Codeception\TestCase\Test.php on line 30

Call Stack:
    0.0090     211064   1. {main}() C:\Users\�������\AppData\Local\Temp\ide-phpunit.php:0
    0.0600     857144   2. IDE_Base_PHPUnit_TextUI_Command::main(???) C:\Users\�������\AppData\Local\Temp\ide-phpunit.php:500
    0.0600     864544   3. PHPUnit_TextUI_Command->run(???, ???) C:\Users\�������\AppData\Local\Temp\ide-phpunit.php:243
    0.1660    2906560   4. PHPUnit_TextUI_TestRunner->doRun(???, ???) phar://C:/Program Files/OpenServer/modules/php/PHP-5.5/phpunit.phar/phpunit/TextUI/Command.php:186
    0.1690    3018336   5. PHPUnit_Framework_TestSuite->run(???) phar://C:/Program Files/OpenServer/modules/php/PHP-5.5/phpunit.phar/phpunit/TextUI/TestRunner.php:423
    0.2030    3029472   6. PHPUnit_Framework_TestCase->run(???) C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\phpunit\phpunit\src\Framework\TestSuite.php:703
    0.2040    3030192   7. PHPUnit_Framework_TestResult->run(???) C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\phpunit\phpunit\src\Framework\TestCase.php:771
    0.2100    3072624   8. PHPUnit_Framework_TestCase->runBare() C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\phpunit\phpunit\src\Framework\TestResult.php:643
    0.2140    3151872   9. yii\codeception\TestCase->setUp() C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\phpunit\phpunit\src\Framework\TestCase.php:831
    0.2140    3151960  10. Codeception\TestCase\Test->setUp() C:\Program Files\OpenServer\domains\dev-mediapoisk.ru\vendor\yiisoft\yii2-codeception\TestCase.php:81


Process finished with exit code 255

Test code:
<?php
namespace backend\tests\unit;

require_once(__DIR__ . '/../_bootstrap.php');

class ExampleTest extends TestCase
{
  function testIt()
  {
    $stack = array();
    $this->assertEquals(0, count($stack));
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aligatro, 2014-09-28
@Aligatro

Here is the supposed answer to your question. Link .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question