mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-23 11:36: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
|
.vagrant
|
||||||
|
|
||||||
/.idea
|
/.idea
|
||||||
/.settings
|
/.settings
|
||||||
/.buildpath
|
/.buildpath
|
||||||
@ -7,3 +6,4 @@
|
|||||||
/composer.lock
|
/composer.lock
|
||||||
/vendor
|
/vendor
|
||||||
/report
|
/report
|
||||||
|
/build
|
@ -6,8 +6,11 @@ php:
|
|||||||
- 5.5
|
- 5.5
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- composer install --dev
|
- composer self-update && composer install --dev
|
||||||
- vendor/tedivm/dovecottesting/SetupEnvironment.sh
|
- 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"
|
"php": ">=5.3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"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": {
|
"autoload": {
|
||||||
"psr-0": {"Fetch": "src/"}
|
"psr-0": {"Fetch": "src/"}
|
||||||
|
@ -11,16 +11,17 @@
|
|||||||
syntaxCheck="false"
|
syntaxCheck="false"
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Fetch Test Suite">
|
<testsuite name="Fetch Test Suite">
|
||||||
<directory>./tests</directory>
|
<directory>./tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist>
|
<whitelist>
|
||||||
<directory suffix=".php">./src/Fetch/</directory>
|
<directory suffix=".php">./src/Fetch/</directory>
|
||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
|
<logging>
|
||||||
|
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
|
||||||
|
</logging>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
@ -24,9 +24,6 @@ if(getenv('TRAVIS'))
|
|||||||
}else{
|
}else{
|
||||||
define('TESTING_ENVIRONMENT', 'VAGRANT');
|
define('TESTING_ENVIRONMENT', 'VAGRANT');
|
||||||
define('TESTING_SERVER_HOST', '172.31.1.2');
|
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';
|
$filename = __DIR__ .'/../vendor/autoload.php';
|
||||||
@ -41,4 +38,4 @@ if (!file_exists($filename)) {
|
|||||||
}else{
|
}else{
|
||||||
$loader = require_once $filename;
|
$loader = require_once $filename;
|
||||||
$loader->add('Fetch\\Test', __DIR__);
|
$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