The Definitive Guide to Yii 2.0
This tutorial is released under the Terms of Yii Documentation.
All Rights Reserved.
2014 (c) Yii Software LLC.
- Getting Started
- Application Structure
- Handling Requests
- Key Concepts
- Working with Databases
- Getting Data from Users
- Displaying Data
- RESTful Web Services
- Development Tools
- Special Topics
Fixtures are an important part of testing. Their main purpose is to set up the environment in a fixed/known state so that your tests are repeatable and run in an expected way. Yii provides a fixture framework that allows you to define your fixtures precisely and use them easily both when running your tests with Codeception and independently.
Acceptance test verifies scenarios from a user's perspective. The application tested is accessed via either PhpBrowser or a real browser. In both cases the browsers are communicating via HTTP so application should be served via web server.
Functional test verifies scenarios from a user's perspective. It is similar to acceptance test but instead of communicating via HTTP it is filling up environment such as POST and GET parameters and then executes application instance right from the code.
A unit test verifies that a single unit of code is working as expected. That is, given different input parameters, the test verifies the class method returns expected results. Unit tests are usually developed by people who write the classes being tested.
Testing environment setup
Yii 2 has officially maintained integration with
Codeception testing framework that allows you to create the following test types:
- Unit - verifies that a single unit of code is working as expected;
- Functional - verifies scenarios from a user's perspective via browser emulation;
- Acceptance - verifies scenarios from a user's perspective in a browser.
Testing is an important part of software development. Whether we are aware of it or not, we conduct testing continuously. For example, when we write a class in PHP, we may debug it step by step or simply use
die statements to verify the implementation works according to our initial plan. In the case of a web application, we're entering some test data in forms to ensure the page interacts with us as expected.
Introduction Article Count: 2
Getting Started Article Count: 8
Application Structure Article Count: 12
Handling Requests Article Count: 8
Key Concepts Article Count: 9
Working with Databases Article Count: 8
Getting Data from Users Article Count: 6
Displaying Data Article Count: 7
Security Article Count: 7
Caching Article Count: 5
RESTful Web Services Article Count: 9
Development Tools Article Count: 3
Testing Article Count: 6
Special Topics Article Count: 12
Widgets Article Count: 2
Helpers Article Count: 4
Page 4 of 18