This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ matrix:
4848 - php : 7.0
4949 env : CHECK_CODESTYLE=1
5050 before_script : ~
51- script :
52- - ./vendor/bin/php-cs-fixer fix --diff --dry-run
53- - ./vendor/bin/phpcs --standard=PSR2 ./lib/ ./tests/
51+ script : composer codestyle:check
5452 after_script : ~
5553 after_success : ~
5654
Original file line number Diff line number Diff line change @@ -29,15 +29,28 @@ To execute all tests simply run:
2929If you want to execute just the unit tests, run:
3030
3131 ./vendor/bin/phpunit --testsuite unit
32+
33+ For the functional tests you must first [ download] ( http://selenium-release.storage.googleapis.com/index.html ) and start
34+ the selenium standalone server, start the local PHP server which will serve the test pages and then run the ` functional `
35+ test suite:
36+
37+ java -jar selenium-server-standalone-2.53.1.jar -log selenium.log &
38+ php -S localhost:8000 -t tests/functional/web/ &
39+ ./vendor/bin/phpunit --testsuite functional
3240
33- For the functional tests you must first download and start the selenium server, then run the ` functional ` test suite:
41+ The functional tests will be started in HtmlUnit headless browser by default. If you want to run them in eg. Firefox,
42+ simply set the ` BROWSER ` environment variable:
3443
35- java -jar selenium-server-standalone-2.48.2.jar -log selenium.log &
44+ ...
45+ export BROWSER_NAME="firefox"
3646 ./vendor/bin/phpunit --testsuite functional
3747
3848### Check coding style
3949
4050Your code-style should comply with [ PSR-2] ( http://www.php-fig.org/psr/psr-2/ ) . To make sure your code matches this requirement run:
4151
42- ./vendor/bin/php-cs-fixer fix --diff --dry-run
43- ./vendor/bin/phpcs --standard=PSR2 ./lib/ ./tests/
52+ composer codestyle:check
53+
54+ To auto-fix the codestyle simply run:
55+
56+ composer codestyle:fix
Original file line number Diff line number Diff line change 3333 "Facebook\\ WebDriver\\ " : [" tests/unit" , " tests/functional" ]
3434 },
3535 "classmap" : [" tests/functional/" ]
36+ },
37+ "scripts" : {
38+ "codestyle:check" : [
39+ " vendor/bin/php-cs-fixer fix --diff --dry-run" ,
40+ " vendor/bin/phpcs --standard=PSR2 ./lib/ ./tests/"
41+ ],
42+ "codestyle:fix" : [
43+ " vendor/bin/php-cs-fixer fix --diff || exit 0" ,
44+ " vendor/bin/phpcbf --standard=PSR2 ./lib/ ./tests/"
45+ ]
3646 }
3747}
You can’t perform that action at this time.
0 commit comments