Book Image

Learning Yii Testing

Book Image

Learning Yii Testing

Overview of this book

Table of Contents (16 chapters)
Learning Yii Testing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Interacting with Codeception


So far, we've seen two arguments of the codecept command:

  • build: This is used for building the "testers" and any additional code when using any additional module

  • run: This is used to execute the tests

There are a few parameters you can invoke run with that I'd like to bring to your attention, as these will come handy when running and debugging the tests. The syntax of the run command is as follows:

$ vendor/bin/codecept run [options] [suite] [test]

First of all, you can run a specific suite, such as unit, acceptance, or functional, or be more specific and run a single test file, for example:

$ ../vendor/bin/codecept run acceptance LoginCept.php

Time: 3.35 seconds, Memory: 13.75Mb

OK (1 test, 5 assertions)

In the preceding command, you can also use the --steps option, which is a way to be more verbose showing all the single steps taken by your tests while running them.

Alternatively, you also have --debug, which will not only show the steps taken by your application...