Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yii2 testing using codeception

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

like image 850
Web Developer Avatar asked Jan 20 '15 08:01

Web Developer


People also ask

What is Codeception in yii2?

Yii Framework provides basic and advanced application templates. Both include sample Codeception tests, thus to start with Codeception you need to start new Yii project from a one of those templates.

What is Codeception PHP?

Codeception is a framework used for creating tests, including unit tests, functional tests, and acceptance tests. Despite the fact that it is based on PHP, the user needs only basic knowledge for starting work with the framework, thanks to the set of custom commands offered by Codeception.


1 Answers

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

composer require yiisoft/yii2-codeception --dev
like image 114
Roman Avatar answered Oct 24 '22 00:10

Roman