Skip to content

Commit 92106d0

Browse files
committed
merged with 2.0
2 parents ee85c33 + b33bbcb commit 92106d0

101 files changed

Lines changed: 2338 additions & 855 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,44 @@ install:
2727
- wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
2828
- composer global require "fxp/composer-asset-plugin:1.0.0"
2929
- composer self-update
30-
- composer install
30+
- composer install --prefer-dist
31+
- ulimit -c unlimited || true
3132
# Queue (Beanstalkd)
3233
- sudo apt-get update -qq
3334
- sudo apt-get install -qq beanstalkd
3435
# Yii2
3536
- composer create-project yiisoft/yii2-app-basic frameworks-yii-basic
3637
# Phalcon
37-
- 'git clone -q --depth=1 https://github.com/phalcon/cphalcon.git -b 1.2.4'
38-
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.6" ]] || (cd cphalcon/ext; export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks -Wall"; phpize &> /dev/null && ./configure --enable-phalcon &> /dev/null && make -j4 && sudo make install && phpenv config-add ../unit-tests/ci/phalcon.ini &> /dev/null && cd ../..;)'
38+
- 'git clone -q --depth=1 https://github.com/phalcon/cphalcon.git -b 1.3.5'
39+
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || (cd cphalcon/ext; export CFLAGS="-g3 -O1 -std=gnu90 -Wall -Werror -Wno-error=uninitialized"; phpize &> /dev/null && ./configure --silent --enable-phalcon &> /dev/null && make --silent -j4 > /dev/null && sudo make --silent install && phpenv config-add ../unit-tests/ci/phalcon.ini &> /dev/null && cd ../..;)'
3940
- 'git clone -q --depth=1 https://github.com/DavertMik/forum.git frameworks-phalcon'
4041
# Laravel 4
4142
- git clone -q https://github.com/Codeception/sample-l4-app.git frameworks-laravel
42-
- composer install -d frameworks-laravel --no-dev
43+
- composer install -d frameworks-laravel --no-dev --prefer-dist
4344
# Laravel 5
4445
- git clone -q https://github.com/janhenkgerritsen/codeception-laravel5-sample.git frameworks-l5
45-
- composer install -d frameworks-l5 --no-dev
46+
- composer install -d frameworks-l5 --no-dev --prefer-dist
4647
# Symfony
47-
- git clone https://github.com/DavertMik/SymfonyCodeceptionApp.git frameworks-symfony
48-
- composer install -d frameworks-symfony --no-dev
49-
48+
- git clone -q https://github.com/DavertMik/SymfonyCodeceptionApp.git frameworks-symfony
49+
- composer install -d frameworks-symfony --no-dev --prefer-dist
50+
# ZF1
51+
- git clone -q --recursive https://github.com/Naktibalda/codeception-zf1-tests frameworks-zf1
52+
- composer install -d frameworks-zf1 --no-dev --prefer-dist
53+
# ZF2
54+
- git clone -q --recursive https://github.com/Naktibalda/codeception-zf2-tests frameworks-zf2
55+
- composer install -d frameworks-zf2 --no-dev --prefer-dist
5056

5157
before_script:
5258
- beanstalkd -d -l 127.0.0.1 -p 11300
5359
- export DISPLAY=:99.0
5460
- sh -e /etc/init.d/xvfb start
5561
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
5662
- java -jar selenium-server-standalone-2.42.2.jar -port 4444 & > /dev/null
63+
- sleep 5
5764
- "mysql -e 'create database codeception_test;'"
5865
- psql -c 'create database codeception_test;' -U postgres
59-
- sleep 5
60-
- php -S localhost:8000 -t tests/data/app &
61-
- php -S localhost:8010 -t tests/data &
66+
- php -S localhost:8000 -t tests/data/app > /dev/null &
67+
- php -S localhost:8010 -t tests/data > /dev/null &
6268
# Phalcon
6369
- "mysql -e 'CREATE DATABASE forum;'"
6470
- cat frameworks-phalcon/schemas/forum.sql | mysql forum
@@ -73,6 +79,11 @@ before_script:
7379
- frameworks-symfony/app/console doctrine:schema:create
7480
- php codecept build -c frameworks-yii-basic/tests
7581
- php codecept build -c frameworks-phalcon
82+
- php codecept build -c frameworks-laravel
83+
- php codecept build -c frameworks-symfony
84+
- php codecept build -c frameworks-l5
85+
- php codecept build -c frameworks-zf1
86+
- php codecept build -c frameworks-zf2
7687
#- php codecept build -c frameworks-laravel
7788
#- php codecept build -c frameworks-symfony
7889
#- php codecept build -c frameworks-l5
@@ -84,3 +95,9 @@ script:
8495
#- php codecept run -c frameworks-l5 # Laravel5 Tests
8596
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.6" ]] || php codecept run functional -c frameworks-phalcon'
8697
#- php codecept run functional -c frameworks-symfony # Symfony Tests
98+
- php codecept run -c frameworks-laravel functional,api,unit # Laravel4 Tests
99+
- php codecept run -c frameworks-l5 # Laravel5 Tests
100+
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept run functional -c frameworks-phalcon'
101+
- php codecept run functional -c frameworks-symfony # Symfony Tests
102+
- php codecept run functional -c frameworks-zf1 # ZF1 Tests
103+
- php codecept run functional -c frameworks-zf2 # ZF2 Tests

CHANGELOG.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
#### 2.0.15
4+
5+
* [REST] Fixed sending `JsonSerializable` object on POST by @Naktibalda and @andersonamuller. See #1988 #1994
6+
* [MongoDb] escaped filename shell argument for loading MongoDB by @christoph-hautzinger. #1998 *2015-06-03*
7+
* [Lumen] Module added by @janhenkgerritsen
8+
39
#### 2.1.0-beta
410

511
* [PhpBrowser][Frameworks] Fixed cloning form nodes Codeception\Lib\InnerBrowser::getFormFromCrawler(): ID XXX already defined *2015-05-13*
@@ -26,7 +32,38 @@
2632

2733
#### 2.0.14
2834

29-
* fixed stderr tput messages in PHPStorm console *2015-04-26*
35+
* Improved output *2015-05-22*
36+
* data providers print simplified
37+
* output respects console size with `tput` and tries to fit area
38+
* non-interactive environments for `tput` are ignored
39+
* [Frameworks][PhpBrowser][Symfony2] Fields are passed as PHP-array on form submission the same way as `Symfony\Component\DomCrawler\Form->getPhpValues()` does. Fixes fails of Symfony form tests *2015-05-22*
40+
* [Laravel4] Fixed bug with filters. See #1810. *2015-05-21*
41+
* [PhpBrowser][Frameworks] Fixed working associative array form fields (like `FooBar[bar]`). Fixes regression #1923 by @davertmik and @zbateson.
42+
* [PhpBrowser][Frameworks] Fixed cloning form nodes Codeception\Lib\InnerBrowser::getFormFromCrawler(): ID XXX already defined *2015-05-13*
43+
* [Laravel4] [Laravel5] Improved error message for `amOnRoute` and `amOnAction` methods if route or action does not exist *2015-05-04*
44+
* [Laravel4] Fixed issue with session configuration *2015-05-01*
45+
* [Laravel4] Partial rewrite of module *2015-05-01*
46+
* Added `getApplication()` method
47+
* Added `seeFormHasErrors()`, `seeFormErrorMessages(array $bindings)` and `seeFormErrorMessage($key, $errorMessage)` methods
48+
* Deprecated `seeSessionHasErrors()` and `seeSessionErrorMessage(array $bindings)` methods.
49+
* fixed stderr output messages in PHPStorm console *2015-04-26*
50+
* Allow following symlinks when searching for tests by @nechutny
51+
* Fixed `g:scenarios --single-file` missing linebreaks between scenarios by @Zifius Parially fixes #1866
52+
* [Frameworks][PhpBrowser] Fixed errors like `[ErrorException] Array to string conversion` when using strict locators. Fix by @neochief #1881
53+
* [Frameworks][PhpBrowser] Fix for URLs with query parameters not properly constructed for GET form submissions by @zbateson Fixes #1891
54+
* [Facebook] Updated Facebook SDK to 4.0 by @enginvardar. See #1896.
55+
* [DB] Quote table name in `Db::getPrimaryKeyColumn` and `Db::deleteQueryMethods` by @Naktibalda. See #1912
56+
* [Silex] Can be used for API functional testing. Improvement by @arduanov See #1945
57+
* [Doctrine2] Added new config option `symfony_em_service` to specify service name for Doctrine entity manager in Symfony DIC by @danieltuwien #1915
58+
* [Db] Reversed order of removing records with foreign keys created by `haveInDatabase`. Fixes #1942 by @satahippy
59+
* [Db] Quote names in PostgreSQL queries. Fix #1916 by @satahippy
60+
* [ZF1] Various improvements by @Naktibalda See #1924
61+
* [ZF2][ZF2] Improved passing request headers by @Naktibalda
62+
* [Phalcon1] Improved dependency injector container check by @sergeyklay #1967
63+
* [Yii2] Enabled logging by @TriAnMan #1539
64+
* Attribute `feature` added to xml reports in `Codeception\TestCase\Test` test report by @tankist. See #1964
65+
* Fixed #1779 by @Naktibalda
66+
* ...special thanks to @Naktibalda for creating demo [ZF1](https://github.com/Naktibalda/codeception-zf1-tests) and [ZF2](https://github.com/Naktibalda/codeception-zf2-tests) applications with api tests examples.
3067

3168
#### 2.0.13
3269

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,20 @@ At Codeception we are glad to receive contributions and patches from the communi
44

55
Please check the guide for sending your contributions with Github at https://github.com/Codeception/Codeception/wiki/Git-workflow-for-Codeception-contributors
66

7+
## Coding Standards
78
All contributions must follow the coding standards described at: https://github.com/Codeception/Codeception/wiki/Codeception-coding-style-standard
9+
10+
## Code
11+
**Bugfixes should be sent to to current stable branch, which is the same as major version number.**
12+
13+
Breaking features and major improvements should be sent into `master`. When you send PRs to master, they will be added to release cycle only when the next stable branch is started.
14+
15+
Check also the "tests/README.md" to learn more about the available internal Codeception tests.
16+
17+
## Documentation
18+
19+
### Guides
20+
If you want to contribute documentation to the guides you are asked to send your changes to the /docs/ folder: https://github.com/Codeception/Codeception/tree/2.0/docs. This files are the source for the codeception website guides: http://codeception.com/docs/01-Introduction. Remind to send your documentation improvements to the right "repository branch" depending on the Codeception version you are working with: 2.0, master,...
21+
22+
### Modules Documentation
23+
The documentation for each module is directly generated from the corresponding docblock which can be found in each module (src/Module/Codeception/*.php).

RoboFile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function buildPhar()
174174
->name('*.ttf')
175175
->name('*.wof')
176176
->name('*.woff')
177+
->name('*.woff2')
177178
->name('*.png')
178179
->name('*.tpl.dist')
179180
->name('*.html.dist')
@@ -518,6 +519,8 @@ public function clean()
518519
$this->taskCleanDir([
519520
'tests/log',
520521
'tests/data/claypit/tests/_output',
522+
'tests/data/claypit/tests/_log',
523+
'tests/data/claypit/tests/_output',
521524
'tests/data/included/_log',
522525
'tests/data/included/jazz/tests/_log',
523526
'tests/data/included/shire/tests/_log',

appveyor.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
build: false
2+
shallow_clone: true
3+
platform: 'x86'
4+
branches:
5+
except:
6+
- gh-pages
7+
8+
services:
9+
- mysql56
10+
- postgresql93
11+
12+
install:
13+
# databases setup
14+
- SET PATH=C:\Program Files\MySql\MySQL Server 5.6\bin\;%PATH%
15+
- SET PGUSER=postgres
16+
- SET PGPASSWORD=Password12!
17+
- SET PATH=C:\Program Files\PostgreSQL\9.3\bin\;%PATH%
18+
# php setup
19+
- cinst -y OpenSSL.Light
20+
- SET PATH=C:\Program Files\OpenSSL;%PATH%
21+
- cinst -y curl
22+
- SET PATH=C:\Program Files\curl;%PATH%
23+
- cinst -y php
24+
- cd c:\tools\php
25+
- copy php.ini-production php.ini
26+
- echo extension_dir=ext >> php.ini
27+
- echo extension=php_openssl.dll >> php.ini
28+
- echo date.timezone="UTC" >> php.ini
29+
- echo extension=php_mbstring.dll >> php.ini
30+
- echo extension=php_curl.dll >> php.ini
31+
- echo extension=php_pdo_mysql.dll >> php.ini
32+
- echo extension=php_pdo_pgsql.dll >> php.ini
33+
- echo extension=php_pgsql.dll >> php.ini
34+
- SET PATH=C:\tools\php;%PATH%
35+
- cd %APPVEYOR_BUILD_FOLDER%
36+
- php -r "readfile('http://getcomposer.org/installer');" | php
37+
- php composer.phar install --prefer-dist -n --no-ansi
38+
39+
before_test:
40+
- createdb codeception_test
41+
- mysql -uroot -pPassword12! -e "CREATE DATABASE codeception_test"
42+
43+
test_script:
44+
- php codecept run cli --no-colors -n --skip-group coverage
45+
- php codecept run unit -g core -g appveyor --no-colors -n

docs/04-FunctionalTests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ Check also all available *Public Properties* of used modules to get full access
226226

227227
By default Codeception uses `E_ALL & ~E_STRICT & ~E_DEPRECATED` error reporting level.
228228
In functional tests you might want to change this level depending on framework's error policy.
229-
The error reporting level can be set in the suite configuraion file:
230-
229+
The error reporting level can be set in the suite configuration file:
230+
231231
```yaml
232232
class_name: FunctionalTester
233233
modules:

docs/08-Customization.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ extensions:
8080

8181
But what are extensions, anyway? Basically speaking, Extensions are nothing more then event listeners based on [Symfony Event Dispatcher](http://symfony.com/doc/current/components/event_dispatcher/introduction.html) component.
8282

83+
<div class="alert">This section requires advanced PHP skills and some knowlegde of Codeception and PHPUnit internals.</div>
84+
85+
Codeception has limited capabilities to extend its core features.
86+
Extensions are not supposed to override current functionality, but are pretty useful if you are experienced developer and you want to hook into testing flow.
87+
88+
Basically speaking, Extensions are nothing more then event listeners based on [Symfony Event Dispatcher](http://symfony.com/doc/current/components/event_dispatcher/introduction.html) component.
89+
8390
Here are the events and event classes. The events are listed in order they happen during execution. Each event has a corresponding class, which is passed to listener, and contains specific objects.
8491

8592
### Events

docs/12-ParallelExecution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ $ robo parallel:run
277277

278278
### Step 3: Merge Results
279279

280-
We should not rely on console output when running our tests. In case of `parallelExec` task, some text can be missed. We recommmend to save results as JUnit XML, which can be merged and plugged into Continous Integration server.
280+
We should not rely on console output when running our tests. In case of `parallelExec` task, some text can be missed. We recommmend to save results as JUnit XML, which can be merged and plugged into Continuous Integration server.
281281

282282
```php
283283
<?php

docs/modules/Asserts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Checks that condition is negative.
4444

4545
### assertGreaterThan
4646

47-
Checks that expected is greater than actual
47+
Checks that actual is greater than expected
4848

4949
* `param` $expected
5050
* `param` $actual
@@ -53,7 +53,7 @@ Checks that expected is greater than actual
5353

5454
### assertGreaterThanOrEqual
5555

56-
Checks that expected is greater or equal than actual
56+
Checks that actual is greater or equal than expected
5757

5858
* `param` $expected
5959
* `param` $actual
@@ -72,7 +72,7 @@ Checks that expected is greater or equal than actual
7272

7373
### assertLessThan
7474

75-
Checks that expected is less than actual
75+
Checks that actual is less than expected
7676

7777
* `param` $expected
7878
* `param` $actual
@@ -81,7 +81,7 @@ Checks that expected is less than actual
8181

8282
### assertLessThanOrEqual
8383

84-
Checks that expected is less or equal than actual
84+
Checks that actual is less or equal than expected
8585

8686
* `param` $expected
8787
* `param` $actual

docs/modules/Doctrine2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ It can be done in bootstrap file, by setting static $em property:
2626

2727
* auto_connect: true - tries to get EntityManager through connected frameworks. If none found expects the $em values specified as described above.
2828
* cleanup: true - all doctrine queries will be run in transaction, which will be rolled back at the end of test.
29+
* symfony_em_service: 'doctrine.orm.entity_manager' - use the stated EntityManager (optional).
2930
* connection_callback: - callable that will return an instance of EntityManager. This is a must if you run Doctrine without Zend2 or Symfony2 frameworks
3031

3132
### Example (`functional.suite.yml`)

0 commit comments

Comments
 (0)