O'Reilly logo

Mastering Yii by Charles R. Portwood II

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring Codeception with Yii2

Before we can use Codeception to test our code, we first need to configure Codeception to work with Yii2:

  1. The preferred way to set up Codeception with Yii2 is to install both the yii2-codeception package and the Codeception base package via Composer:
    $ composer require --dev codeception/codeception
    $ composer require --dev yiisoft/yii2-codeception
    $ composer require --dev yiisoft/yii2-faker
    

    Tip

    The --dev flag on our composer command ensures that development packages are not installed in our production environment. Packages installed with –dev will be added to the require-dev section of our composer.json file. Storing Codeception and other testing code reduces the dependencies we need in production and makes our code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required