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

Seeing tests pass


As you might have guessed, it's again time to run Codeception against our UserTest class:

$ ../vendor/bin/codecept run unit models/UserTest.php
Codeception PHP Testing Framework v2.0.6
Powered by PHPUnit 4.4-dev by Sebastian Bergmann.

Unit Tests (14) -----------------------------
Trying to test validate returns false if parameters are not set (tests\codeception\unit\models\UserTest::testValidateReturnsFalseIfParametersAreNotSet)                              Ok
[snip]


Time: 3.61 seconds, Memory: 28.75Mb

OK (27 tests, 53 assertions)

You should have all tests passing without problems, and you should also be able to fix them in case an error is raised.

If we decide to run all the tests, including those that were already there, we might see that some tests are not passing anymore. Don't worry, this is quite normal as we've changed the way the User model works and behaves internally. In particular, the error I'm getting is the following regarding LoginFormTest, but Codeception...