6

I am writing a simple test case. I installed codeception using composer. My test cases are located in root folder inside test case folder

when i try to run the following code

namespace app\tests\testcases;

use yii\codeception\TestCase;

class SomeMyTest extends TestCase
{

public function testOne()
{
    echo "here";
}



}

when i try to run the code in a browser i get the following error

 Fatal error: Class 'yii\codeception\TestCase' not found 

There is this file called as yiisoft\yii2-codeception\TestCase.php in my project

What am i doing wrong? Can anyone help.?

4
  • I followed instruction given in [link]github.com/yiisoft/yii2-app-basic/tree/master/tests[/link]. I get the following error. [Codeception\Exception\Configuration] Configuration file could not be found. Run bootstrap to initialize Codeception. build [-c|--config[="..."]] Commented Jan 21, 2015 at 6:56
  • Do we need to add any settings to config file of yii ton use te test feature? Commented Jan 22, 2015 at 6:14
  • I feel its something to do with the configuration file. Did anyone used this before? Commented Jan 22, 2015 at 6:50
  • Did you run the "codecept bootstrap" command? Commented Jan 31, 2018 at 18:29

2 Answers 2

1

https://github.com/yiisoft/yii2-codeception

composer require yiisoft/yii2-codeception --dev
Sign up to request clarification or add additional context in comments.

Comments

0

Install codeception using this commands

composer require codeception/codeception
composer require codeception/specify
composer require codeception/verify

More at https://www.yiiframework.com/doc/guide/2.0/en/test-environment-setup

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.