From 8ebcc245bba0bc0674308109138625d68305055d Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Thu, 3 Apr 2014 11:52:09 +0200 Subject: [PATCH 1/6] Moved out phpunit configuration --- .gitignore | 4 +++- .travis.yml | 4 ++-- phpunit.xml.dist | 18 ++++++++++++++++++ tests/bootstrap.php | 16 ++++++++++++---- tests/phpunit.xml | 20 -------------------- 5 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 phpunit.xml.dist delete mode 100644 tests/phpunit.xml diff --git a/.gitignore b/.gitignore index 91bbb39..d38c5d0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ vendor/ composer.lock composer.phar -*.log \ No newline at end of file +*.log +phpunit.xml +build/ diff --git a/.travis.yml b/.travis.yml index 8523fe4..7821523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,12 +17,12 @@ before_script: - tests/travis/sphinx-setup.sh script: - - vendor/bin/phpunit -c tests/ + - vendor/bin/phpunit after_script: - vendor/bin/coveralls -v - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover tests/build/logs/clover.xml + - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml notifications: email: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..46541f8 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + tests/SphinxSearchTest + + + + + library/ + + + + + + + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2a7f86d..b4acc71 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,11 +1,19 @@ , Leonardo Grasso + * @link https://github.com/ripaclub/matryoshka + * @copyright Copyright (c) 2014, Ripa Club * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License */ -// Set the decimal separator to "C" (i.e. minimal "C" locale) + +chdir(__DIR__); setlocale(LC_NUMERIC, 'C'); + +if (!file_exists('../vendor/autoload.php')) { + throw new \RuntimeException('vendor/autoload.php not found. Run a composer install.'); +} + +$autoloader = include '../vendor/autoload.php'; +$autoloader->add('SphinxSearchTest', __DIR__); diff --git a/tests/phpunit.xml b/tests/phpunit.xml deleted file mode 100644 index 654af8b..0000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - SphinxSearchTest - - - - - ../library - - - - - - - - \ No newline at end of file From 2d241f6571544b4bb812b2980d5d19c1b8e3afd2 Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Thu, 3 Apr 2014 15:39:34 +0200 Subject: [PATCH 2/6] WTF --- tests/bootstrap.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b4acc71..781c52b 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,13 +1,14 @@ + * @link https://github.com/ripaclub/sphinxsearch + * @copyright Copyright (c) 2014, + * Leonardo Di Donato + * Leonardo Grasso * @license http://opensource.org/licenses/BSD-2-Clause Simplified BSD License */ - chdir(__DIR__); setlocale(LC_NUMERIC, 'C'); From 577b3dfc41466069d7c1eb0b90c1537c2cf7140b Mon Sep 17 00:00:00 2001 From: Lorenzo Fontana Date: Thu, 3 Apr 2014 16:23:54 +0200 Subject: [PATCH 3/6] Restored comment --- tests/bootstrap.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 781c52b..05558c2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,6 +10,8 @@ */ chdir(__DIR__); + +// Set the decimal separator to "C" (i.e. minimal "C" locale) setlocale(LC_NUMERIC, 'C'); if (!file_exists('../vendor/autoload.php')) { From b19077df3405f4edf9e3f8c17b1eb91ec676621b Mon Sep 17 00:00:00 2001 From: Leo Di Donato Date: Fri, 29 Aug 2014 13:25:56 +0200 Subject: [PATCH 4/6] Code quality tools upgraded --- .coveralls.yml | 4 ++-- .gitignore | 2 +- .travis.yml | 9 +++++---- README.md | 17 ++++++----------- composer.json | 10 +++++----- phpmd.xml => phpmd.xml.dist | 0 6 files changed, 19 insertions(+), 23 deletions(-) rename phpmd.xml => phpmd.xml.dist (100%) diff --git a/.coveralls.yml b/.coveralls.yml index 7683234..1f17488 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,4 +1,4 @@ src_dir : library service_name : travis-ci -coverage_clover : tests/build/logs/clover.xml -json_path : tests/build/logs/coveralls-upload.json \ No newline at end of file +coverage_clover : build/logs/clover.xml +json_path : build/logs/coveralls-upload.json \ No newline at end of file diff --git a/.gitignore b/.gitignore index d38c5d0..c12439b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ composer.lock composer.phar *.log phpunit.xml -build/ +build/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 7821523..7f4729e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ php: branches: only: - master + - develop install: - composer self-update && composer --version @@ -17,12 +18,12 @@ before_script: - tests/travis/sphinx-setup.sh script: - - vendor/bin/phpunit + - vendor/bin/phpunit after_script: - - vendor/bin/coveralls -v - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + - vendor/bin/coveralls + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml notifications: email: false diff --git a/README.md b/README.md index 838129a..7bac1f2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Sphinx Search library provides SphinxQL indexing and searching features. - [SQL Objects](#sql-objects) - [Query expression](#query-expression) - [Testing](#testing) +- [Code quality](#code-quality) ## Introduction @@ -339,13 +340,7 @@ The library source code (on master) is 100% covered by unit tests. Once installed development dependencies through composer you can run `phpunit`. ``` -vendor/bin/phpunit -c tests/ -``` - -After this you can inspect stats about code coverage. - -``` -vendor/bin/converalls -v +./vendor/bin/phpunit -c tests/ ``` Code quality @@ -354,23 +349,23 @@ Code quality Run [phpmd](https://github.com/phpmd/phpmd). ``` -vendor/bin/phpmd library/ text phpmd.xml +./vendor/bin/phpmd library/ text phpmd.xml.dist ``` Run [phpcs](https://github.com/squizlabs/PHP_CodeSniffer). ``` -vendor/bin/phpcs --standard=PSR2 library/ +./vendor/bin/phpcs --standard=PSR2 library/ ``` Run [pdepend](https://github.com/pdepend/pdepend). ``` -vendor/bin/pdepend --exclude=tests,vendor --summary-xml=pdepend.log library/ +./vendor/bin/pdepend --exclude=tests,vendor --summary-xml=pdepend.log library/ ``` Run [php-cs-fixer](https://github.com/fabpot/PHP-CS-Fixer). ``` -vendor/bin/php-cs-fixer fix library/ --level=psr2 +./vendor/bin/php-cs-fixer fix . --level=psr2 ``` diff --git a/composer.json b/composer.json index 55c6fa9..42b0061 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ "zendframework/zend-servicemanager": ">=2.2" }, "require-dev": { - "phpunit/phpunit": ">=4.0", - "phpmd/phpmd": "1.5.*", - "pdepend/pdepend": "1.1.*", + "phpunit/phpunit": "4.0.*", + "phpmd/phpmd": "2.0.*", + "satooshi/php-coveralls": "0.6.*", + "pdepend/pdepend": "2.0.*", "squizlabs/php_codesniffer": "1.5.*", - "fabpot/php-cs-fixer": "*", - "satooshi/php-coveralls": "dev-master" + "fabpot/php-cs-fixer": "0.5.*" }, "authors": [ { diff --git a/phpmd.xml b/phpmd.xml.dist similarity index 100% rename from phpmd.xml rename to phpmd.xml.dist From 0170cce9c150d3c6a5852b18519e80399f3ebc87 Mon Sep 17 00:00:00 2001 From: Leo Di Donato Date: Fri, 29 Aug 2014 15:28:19 +0200 Subject: [PATCH 5/6] Dependences cleaned --- .travis.yml | 2 +- README.md | 6 ------ composer.json | 3 +-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f4729e..5a6cc80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ branches: install: - composer self-update && composer --version - - composer install --dev --prefer-source + - composer install --dev before_script: - tests/travis/sphinx-setup.sh diff --git a/README.md b/README.md index 7bac1f2..b6e4251 100644 --- a/README.md +++ b/README.md @@ -363,9 +363,3 @@ Run [pdepend](https://github.com/pdepend/pdepend). ``` ./vendor/bin/pdepend --exclude=tests,vendor --summary-xml=pdepend.log library/ ``` - -Run [php-cs-fixer](https://github.com/fabpot/PHP-CS-Fixer). - -``` -./vendor/bin/php-cs-fixer fix . --level=psr2 -``` diff --git a/composer.json b/composer.json index 42b0061..45fd50d 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,7 @@ "phpmd/phpmd": "2.0.*", "satooshi/php-coveralls": "0.6.*", "pdepend/pdepend": "2.0.*", - "squizlabs/php_codesniffer": "1.5.*", - "fabpot/php-cs-fixer": "0.5.*" + "squizlabs/php_codesniffer": "1.5.*" }, "authors": [ { From f70840e57e149ba4e9199323845cd2dc9aa1b030 Mon Sep 17 00:00:00 2001 From: Leo Di Donato Date: Fri, 29 Aug 2014 15:35:46 +0200 Subject: [PATCH 6/6] Coveralls removed --- .coveralls.yml | 4 ---- .travis.yml | 1 - README.md | 8 ++++++-- composer.json | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 1f17488..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,4 +0,0 @@ -src_dir : library -service_name : travis-ci -coverage_clover : build/logs/clover.xml -json_path : build/logs/coveralls-upload.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5a6cc80..814f70c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ script: - vendor/bin/phpunit after_script: - - vendor/bin/coveralls - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml diff --git a/README.md b/README.md index b6e4251..9992a71 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Sphinx Search [![Build Status](https://travis-ci.org/ripaclub/sphinxsearch.png?branch=master)](https://travis-ci.org/ripaclub/sphinxsearch) [![Latest Stable Version](https://poser.pugx.org/ripaclub/sphinxsearch/v/stable.png)](https://packagist.org/packages/ripaclub/sphinxsearch) [![Coverage Status](https://coveralls.io/repos/ripaclub/sphinxsearch/badge.png?branch=master)](https://coveralls.io/r/ripaclub/sphinxsearch?branch=master) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/quality-score.png?s=ee5fd3ec2556ba441dc3ca598cee7ebdb41daa3c)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/) [![Analytics](https://ga-beacon.appspot.com/UA-49655829-1/ripaclub/sphinxsearch)](https://github.com/igrigorik/ga-beacon) +Sphinx Search [![Build Status](https://travis-ci.org/ripaclub/sphinxsearch.png?branch=master)](https://travis-ci.org/ripaclub/sphinxsearch) [![Latest Stable Version](https://poser.pugx.org/ripaclub/sphinxsearch/v/stable.png)](https://packagist.org/packages/ripaclub/sphinxsearch) [![Code Coverage](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/?branch=master) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/badges/quality-score.png?s=ee5fd3ec2556ba441dc3ca598cee7ebdb41daa3c)](https://scrutinizer-ci.com/g/ripaclub/sphinxsearch/) ============= Sphinx Search library provides SphinxQL indexing and searching features. @@ -335,7 +335,7 @@ echo $select->getSqlString(new SphinxQL()); Testing ------- -The library source code (on master) is 100% covered by unit tests. +The library source code (**on master**) is 100% covered by unit tests. Once installed development dependencies through composer you can run `phpunit`. @@ -363,3 +363,7 @@ Run [pdepend](https://github.com/pdepend/pdepend). ``` ./vendor/bin/pdepend --exclude=tests,vendor --summary-xml=pdepend.log library/ ``` + +--- + +[![Analytics](https://ga-beacon.appspot.com/UA-49655829-1/ripaclub/sphinxsearch)](https://github.com/igrigorik/ga-beacon) \ No newline at end of file diff --git a/composer.json b/composer.json index 45fd50d..6d189f9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,6 @@ "require-dev": { "phpunit/phpunit": "4.0.*", "phpmd/phpmd": "2.0.*", - "satooshi/php-coveralls": "0.6.*", "pdepend/pdepend": "2.0.*", "squizlabs/php_codesniffer": "1.5.*" },