Answer the question
In order to leave comments, you need to log in
Why doesn't Codeception work on Yii1?
Hello. Installed and configured Codeception on Yii ( codeception.com/docs/modules/Yii1 ).
1. Wrote the first test
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('create wiki page');
$I->amOnPage('/');
?>
~protected>D:\OpenServer\modules\php\PHP-5.6\php.exe codecept.phar run
Time: 163 ms, Memory: 8.00Mb
There was 1 error:
---------
1) Failed to create wiki page in WelcomeCept (D:\OpenServer\domains\site\app\protected\tests\functional\WelcomeCept.php)
Can't be on page "/":
CHttpException: Unable to resolve the request "site".
Scenario Steps:
1. I am on page "/"
#1 D:\OpenServer\domains\site\framework\web\CWebApplication.php:141
#2 D:\OpenServer\domains\site\framework\base\CApplication.php:180
#3 Codeception\Lib\InnerBrowser->amOnPage
#4 D:\OpenServer\domains\site\app\protected\tests\acceptance\AcceptanceTester.php:112
#5 D:\OpenServer\domains\site\app\protected\tests\functional\WelcomeCept.php:4
#6 Codeception\TestCase\Cept->testCodecept
#7 D:\OpenServer\domains\site\app\protected\codecept.phar:7
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
CHttpException: Unable to resolve the request "site".
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: false
memory_limit: 1024M
modules:
enabled: [PhpBrowser, WebHelper, TestHelper, Yii1]
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
PhpBrowser:
url: http://site
Yii1:
appPath: ../test.php
url: http://site/test.php
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../framework/yii.php';
$config=dirname(__FILE__).'/protected/config/test.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
return array(
'class' => 'CWebApplication',
'config' => $config,
);
<?php return array(
'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
'components' => array(
'request' => array(
'class' => 'CodeceptionHttpRequest',
),
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question