Book Image

Mastering Yii

By : Charles R. Portwood ll
Book Image

Mastering Yii

By: Charles R. Portwood ll

Overview of this book

The successor of Yii Framework 1.1, Yii 2 is a complete rewrite of Yii Framework, one of the most popular PHP 5 frameworks around for making modern web applications. The update embraces the best practices and protocols established with newer versions of PHP, while still maintaining the simple, fast, and extendable behavior found in its predecessor. This book has been written to enhance your skills and knowledge with Yii Framework 2. Starting with configuration and how to initialize new projects, you’ll learn how to configure, manage, and use every aspect of Yii2 from Gii, DAO, Query Builder, Active Record, and migrations, to asset manager. You'll also discover how to automatically test your code using codeception. With this book by your side, you’ll have all the skills you need to quickly create rich modern web and console applications with Yii 2.
Table of Contents (20 chapters)
Mastering Yii
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
5
Modules, Widgets, and Helpers
13
Debugging and Deploying
Index

Automatic change testing


An important aspect of testing is ensuring that your tests are run regularly and often. If you're following the test-driven development philosophy, you should be writing your tests before writing code and adapting your tests as new code is added. While this will give you a good idea of what is working and what isn't, it can be extremely time-consuming, and it doesn't cover cases where team members make changes but either don't write tests or don't run them before committing and pushing them to your DCVS repository.

The best way to ensure that your tests are run after every change is to use a third-party service, such as Travis CI. A tool such as Travis CI will add a webbook to your repository, and after every commit, it can be configured to run all your tests and notify you if and when your tests ever start failing.

Tip

In general, you should always verify that your code runs and that your tests pass before committing it to your repository.

Using Travis CI as an example...