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.?

realtebo
  • 23,922
  • 37
  • 112
  • 189
Web Developer
  • 133
  • 2
  • 14
  • I followed instruction given in [link]https://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[="..."]] – Web Developer Jan 21 '15 at 06:56
  • Do we need to add any settings to config file of yii ton use te test feature? – Web Developer Jan 22 '15 at 06:14
  • I feel its something to do with the configuration file. Did anyone used this before? – Web Developer Jan 22 '15 at 06:50
  • Did you run the "codecept bootstrap" command? – nicolascolman Jan 31 '18 at 18:29

2 Answers2

1

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

composer require yiisoft/yii2-codeception --dev
Roman
  • 51
  • 6
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

Yasar Arafath
  • 605
  • 1
  • 9
  • 30