mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-27 05:06:02 +03:00
Added code coverage and styling tests, refactored
Added runTests.sh to wrap up a bunch of test starting functionality. Moved SetupEnvironment.sh out of Bootstrap.php and into the runTests.sh file. Added Coverall support for line coverage. Added php-cs-fixer for code styling testing.
This commit is contained in:
parent
8650586610
commit
faaff0711d
3
.coveralls.yml
Normal file
3
.coveralls.yml
Normal file
@ -0,0 +1,3 @@
|
||||
src_dir: src
|
||||
coverage_clover: build/logs/clover.xml
|
||||
json_path: build/logs/coveralls-upload.json
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
.vagrant
|
||||
|
||||
/.idea
|
||||
/.settings
|
||||
/.buildpath
|
||||
@ -7,3 +6,4 @@
|
||||
/composer.lock
|
||||
/vendor
|
||||
/report
|
||||
/build
|
@ -6,8 +6,11 @@ php:
|
||||
- 5.5
|
||||
|
||||
before_script:
|
||||
- composer install --dev
|
||||
- composer self-update && composer install --dev
|
||||
- vendor/tedivm/dovecottesting/SetupEnvironment.sh
|
||||
|
||||
|
||||
script: phpunit --verbose --coverage-text
|
||||
script: ./tests/runTests.sh
|
||||
|
||||
after_script:
|
||||
- php vendor/bin/coveralls -v
|
@ -15,7 +15,11 @@
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"tedivm/dovecottesting": "1.2.1"
|
||||
"tedivm/dovecottesting": "1.2.1",
|
||||
"phpunit/phpunit": "4.0.*",
|
||||
"fabpot/php-cs-fixer": "0.4.0",
|
||||
"satooshi/php-coveralls": "dev-master"
|
||||
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {"Fetch": "src/"}
|
||||
|
@ -11,16 +11,17 @@
|
||||
syntaxCheck="false"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Fetch Test Suite">
|
||||
<directory>./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./src/Fetch/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
|
@ -24,9 +24,6 @@ if(getenv('TRAVIS'))
|
||||
}else{
|
||||
define('TESTING_ENVIRONMENT', 'VAGRANT');
|
||||
define('TESTING_SERVER_HOST', '172.31.1.2');
|
||||
echo 'Initializing Environment using Vagrant' . PHP_EOL;
|
||||
passthru('/bin/bash ' . __DIR__ . '/../vendor/tedivm/dovecottesting/SetupEnvironment.sh');
|
||||
echo 'Environment Initialized' . PHP_EOL . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
$filename = __DIR__ .'/../vendor/autoload.php';
|
||||
@ -41,4 +38,4 @@ if (!file_exists($filename)) {
|
||||
}else{
|
||||
$loader = require_once $filename;
|
||||
$loader->add('Fetch\\Test', __DIR__);
|
||||
}
|
||||
}
|
||||
|
17
tests/runTests.sh
Executable file
17
tests/runTests.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#/usr/bin/env/sh
|
||||
set -e
|
||||
|
||||
if [ ! -n "$TRAVIS" ]; then
|
||||
./vendor/tedivm/dovecottesting/SetupEnvironment.sh
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
echo 'Running unit tests.'
|
||||
phpunit --verbose --coverage-clover build/logs/clover.xml
|
||||
|
||||
echo ''
|
||||
echo ''
|
||||
echo ''
|
||||
echo 'Testing for Coding Styling Compliance.'
|
||||
echo 'All code should follow PSR standards.'
|
||||
./vendor/fabpot/php-cs-fixer/php-cs-fixer fix ./ --level="all" -vv --dry-run
|
Loading…
Reference in New Issue
Block a user