commit | author | age
|
2207d6
|
1 |
# Codeception |
W |
2 |
|
|
3 |
[![Latest Stable](https://poser.pugx.org/Codeception/Codeception/version.png)](https://packagist.org/packages/Codeception/Codeception) |
|
4 |
[![Total Downloads](https://poser.pugx.org/codeception/codeception/downloads.png)](https://packagist.org/packages/codeception/codeception) |
|
5 |
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Codeception/Codeception/badges/quality-score.png?b=2.4)](https://scrutinizer-ci.com/g/Codeception/Codeception/?branch=2.4) |
|
6 |
|
|
7 |
**Modern PHP Testing for everyone** |
|
8 |
|
|
9 |
Codeception is a modern full-stack testing framework for PHP. |
|
10 |
Inspired by BDD, it provides an absolutely new way of writing acceptance, functional and even unit tests. |
|
11 |
Powered by PHPUnit. |
|
12 |
|
|
13 |
| General | Windows | Webdriver | HHVM | |
|
14 |
| ------- | -------- | -------- | -------- | |
|
15 |
| [![Build Status](https://secure.travis-ci.org/Codeception/Codeception.png?branch=2.4)](http://travis-ci.org/Codeception/Codeception) | [![Build status](https://ci.appveyor.com/api/projects/status/ntjj9i4y67d1rb7y?svg=true)](https://ci.appveyor.com/project/DavertMik/codeception/branch/2.4) | [![Build Status](https://semaphoreci.com/api/v1/codeception/codeception/branches/master/shields_badge.svg)](https://semaphoreci.com/codeception/codeception) | [![wercker status](https://app.wercker.com/status/b4eecd0596bedb65333ff7ab7836bc7f/s/ "wercker status")](https://app.wercker.com/project/byKey/b4eecd0596bedb65333ff7ab7836bc7f) | |
|
16 |
|
|
17 |
#### Contributions |
|
18 |
|
|
19 |
At Codeception we are glad to receive contributions from the community. If you want to send additions or fixes to the code or the documentation please check the [Contributing guide](https://github.com/Codeception/Codeception/blob/2.4/CONTRIBUTING.md). |
|
20 |
|
|
21 |
### At a Glance |
|
22 |
|
|
23 |
Describe what you test and how you test it. Use PHP to write descriptions faster. |
|
24 |
|
|
25 |
Run tests and see what actions were taken and what results were seen. |
|
26 |
|
|
27 |
#### Sample test |
|
28 |
|
|
29 |
``` php |
|
30 |
$I->wantTo('create wiki page'); |
|
31 |
$I->amOnPage('/'); |
|
32 |
$I->click('Pages'); |
|
33 |
$I->click('New'); |
|
34 |
$I->see('New Page'); |
|
35 |
$I->submitForm('form#new_page', ['title' => 'Movie Review']); |
|
36 |
$I->see('page created'); // notice generated |
|
37 |
$I->see('Movie Review','h1'); // head of page of is our title |
|
38 |
$I->seeInCurrentUrl('pages/movie-review'); // slug is generated |
|
39 |
$I->seeInDatabase('pages', ['title' => 'Movie Review']); // data is stored in database |
|
40 |
``` |
|
41 |
|
|
42 |
For unit testing you can stay on classic PHPUnit tests, as Codeception can run them too. |
|
43 |
|
|
44 |
## Installation |
|
45 |
|
|
46 |
### Composer |
|
47 |
|
|
48 |
``` |
|
49 |
php composer.phar require "codeception/codeception" |
|
50 |
``` |
|
51 |
|
|
52 |
### Phar |
|
53 |
|
|
54 |
Download [codecept.phar](http://codeception.com/codecept.phar) |
|
55 |
|
|
56 |
Copy it into your project. |
|
57 |
|
|
58 |
You can also make Codeception an executable and it put it into your `$PATH`, for instance: |
|
59 |
|
|
60 |
``` |
|
61 |
wget http://codeception.com/codecept.phar |
|
62 |
|
|
63 |
chmod +x codecept.phar |
|
64 |
|
|
65 |
sudo mv codecept.phar /usr/local/bin/codecept |
|
66 |
|
|
67 |
``` |
|
68 |
|
|
69 |
You can then run Codecept in the command line using: `codecept bootstrap`, `codecept run`, etc |
|
70 |
|
|
71 |
Run CLI utility: |
|
72 |
|
|
73 |
``` |
|
74 |
php codecept.phar |
|
75 |
``` |
|
76 |
|
|
77 |
See also [Installation](http://codeception.com/install) | **[QuickStart](http://codeception.com/quickstart)** |
|
78 |
|
|
79 |
## Getting Started |
|
80 |
|
|
81 |
After you successfully installed Codeception, run this command: |
|
82 |
|
|
83 |
``` |
|
84 |
codecept bootstrap |
|
85 |
``` |
|
86 |
|
|
87 |
This will create a default directory structure and default test suites. |
|
88 |
|
|
89 |
## Documentation |
|
90 |
|
|
91 |
[Documentation](http://codeception.com/docs/01-Introduction) |
|
92 |
|
|
93 |
Documentation is included within the project. Look for it in the ['docs' directory](https://github.com/Codeception/Codeception/tree/master/docs). |
|
94 |
|
|
95 |
## License |
|
96 |
MIT |
|
97 |
|
|
98 |
(c) [Codeception Team](http://codeception.com/credits) |
|
99 |
2011-2018 |