Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Yii

You're reading from   Mastering Yii Advance your modern web application development skills with Yii Framework 2

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher Packt
ISBN-13 9781785882425
Length 380 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Charles R. Portwood ll Charles R. Portwood ll
Author Profile Icon Charles R. Portwood ll
Charles R. Portwood ll
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Mastering Yii
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Composer, Configuration, Classes, and Path Aliases FREE CHAPTER 2. Console Commands and Applications 3. Migrations, DAO, and Query Building 4. Active Record, Models, and Forms 5. Modules, Widgets, and Helpers 6. Asset Management 7. Authenticating and Authorizing Users 8. Routing, Responses, and Events 9. RESTful APIs 10. Testing with Codeception 11. Internationalization and Localization 12. Performance and Security 13. Debugging and Deploying Index

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 more secure.

    The first package contains the Codeception binary that we'll use to generate and execute our tests, while the second package contains Yii2-specific helpers and bindings that Codeception will use to tightly integrate into Yii2.

    Note

    This...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images