Run languages tests using PHPUnit test suites

This commit is contained in:
ArthurHoaro 2017-01-15 16:31:53 +01:00
parent 52b503105d
commit 6c7d686454
4 changed files with 38 additions and 7 deletions

View file

@ -1,5 +1,11 @@
sudo: false sudo: false
language: php language: php
addons:
apt:
packages:
- locales
- language-pack-de
- language-pack-fr
cache: cache:
directories: directories:
- $HOME/.composer/cache - $HOME/.composer/cache

View file

@ -124,8 +124,20 @@ test:
@echo "-------" @echo "-------"
@echo "PHPUNIT" @echo "PHPUNIT"
@echo "-------" @echo "-------"
@mkdir -p sandbox @mkdir -p sandbox coverage
@$(BIN)/phpunit tests @$(BIN)/phpunit --coverage-php coverage/main.cov --testsuite unit-tests
locale_test_%:
@UT_LOCALE=$*.utf8 \
$(BIN)/phpunit \
--coverage-php coverage/$(firstword $(subst _, ,$*)).cov \
--bootstrap tests/languages/bootstrap.php \
--testsuite language-$(firstword $(subst _, ,$*))
all_tests: test locale_test_de_DE locale_test_en_US locale_test_fr_FR
@$(BIN)/phpcov merge --html coverage coverage
@# --text doesn't work with phpunit 4.* (v5 requires PHP 5.6)
@#$(BIN)/phpcov merge --text coverage/txt coverage
## ##
# Custom release archive generation # Custom release archive generation

View file

@ -20,7 +20,8 @@
"phpmd/phpmd" : "@stable", "phpmd/phpmd" : "@stable",
"phpunit/phpunit": "4.8.*", "phpunit/phpunit": "4.8.*",
"sebastian/phpcpd": "*", "sebastian/phpcpd": "*",
"squizlabs/php_codesniffer": "2.*" "squizlabs/php_codesniffer": "2.*",
"phpunit/phpcov": "*"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View file

@ -3,13 +3,25 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
colors="true"> colors="true">
<testsuites>
<testsuite name="unit-tests">
<directory>tests</directory>
<exclude>tests/languages</exclude>
</testsuite>
<testsuite name="language-de">
<directory>tests/languages/de</directory>
</testsuite>
<testsuite name="language-en">
<directory>tests/languages/en</directory>
</testsuite>
<testsuite name="language-fr">
<directory>tests/languages/fr</directory>
</testsuite>
</testsuites>
<filter> <filter>
<whitelist addUncoveredFilesFromWhitelist="true"> <whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">application</directory> <directory suffix=".php">application</directory>
</whitelist> </whitelist>
</filter> </filter>
<logging>
<log type="coverage-html" target="coverage" lowUpperBound="30" highLowerBound="80"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
</logging>
</phpunit> </phpunit>