![]() Now, we get an acceptance test file tests/acceptance/HelloWorldCept.php, with the following content: wantTo('perform actions and see result') $ php vendor/bin/codecept generate:cept acceptance HelloWorld Now, try to add a standard acceptance Hello World test. It looks like we can start writing our tests. So how do you install Codeception? It is as simple as it gets: $ composer require "codeception/codeception"Īfter installing, you will find a new folder named tests in your project, and there will be some subfolders named acceptance, functional and unit. At first, I was skeptical, as we often are when it comes to something new (this project is five years old, so technically, it can’t be considered “new”), but after playing around with it for a couple of days, I concluded Codeception is a very useful and powerful system. A while ago, I decided to find something more useful than PHPUnit I wanted to be better at testing my code, but I didn’t want to read and learn tons of documentation and look for pitfalls. I used to be one such developer I found using different systems for different types of tests too difficult and time-consuming. Many developers use unit tests and claim that’s enough. However, this division is conditional and sometimes it is difficult to resist the temptation of mixing different kinds of tests. Acceptance testing involves testing the entire building as a complete product: Open the door, go inside, shut the door, switch on the light, climb to the second floor and take a look at the garden outside the building. Functional tests can be likened to tests on a single wall of the building, to check whether or not the interior is protected from the elements, and whether or not it possible to see the sun through the window. The idea of integrational tests is to check how tightly and accurately the bricks adhere to each other, how they’re integrated into a certain element of the building. Each brick has to meet specified requirements it has to withstand the required load, have a specific volume and shape, and so on. A building is composed of small blocks that form walls. ![]() To clarify, let’s say we illustrate the process with something tangible, such as a building.
0 Comments
Leave a Reply. |