Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Commit

Permalink
Consolidate testing environment
Browse files Browse the repository at this point in the history
- Remove `tests/bootstrap.php` by:
  * Using `autoload-dev` in Composer instead of
    manually adding namespaces to its autoloader on the fly
  * Using PHPUnit `<ini>` XML configuration to set up
    `display_errors`, `error_reporting` and `date.timezone`
- Require `phpunit/phpunit` as a dev dependency instead of depending
  on the platform installation.
  See discussion about that here: silexphp/Silex#1075
- Use new Composer custom commands with `scripts`.
  `composer run-script test` is now just `composer test`.

So you could now just `composer install` and `composer test`. Everything
else is taked care of in a minimalistic, but still well-defined way.
  • Loading branch information
hkdobrev committed Dec 15, 2014
1 parent a9124e1 commit 8ecfd6f
Show file tree
Hide file tree
Showing 5 changed files with 810 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -12,6 +12,6 @@ install: composer install --optimize-autoloader --no-interaction

before_script: mysql -e 'create database `estaty_test`;'

script: phpunit --coverage-clover=coverage.clover
script: composer test-ci

after_script: if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
after_script: if [ -f build/coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover build/coverage.clover; fi
13 changes: 12 additions & 1 deletion composer.json
Expand Up @@ -16,11 +16,22 @@
"doctrine/orm": "~2.4.6"
},
"require-dev": {
"silex/web-profiler": "~1.0.3"
"silex/web-profiler": "~1.0.3",
"phpunit/phpunit": "~4.4"
},
"autoload": {
"psr-4": {
"Estaty\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Estaty\\Test\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --coverage-html=build/coverage",
"test-ci": "phpunit --coverage-clover=build/coverage.clover"
}
}

0 comments on commit 8ecfd6f

Please sign in to comment.