From 0fd187b9ee07eaf08ea26659bf830a1e7af89b93 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Wed, 4 Jun 2014 23:21:27 +0700 Subject: [PATCH 1/3] QA: Fix path in test bootstrap and apply custom PHPCS rule --- .gitignore | 3 +-- .travis.yml | 5 +++-- phpcs.xml => phpcs.xml.dist | 0 tests/bootstrap.php | 7 +++---- 4 files changed, 7 insertions(+), 8 deletions(-) rename phpcs.xml => phpcs.xml.dist (100%) diff --git a/.gitignore b/.gitignore index acc455a31..8f7ca038e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ Thumbs.db Desktop.ini .idea -_build +build/ phpunit.xml composer.lock composer.phar @@ -13,4 +13,3 @@ vendor *.settings *.project *.buildpath -Tests/results diff --git a/.travis.yml b/.travis.yml index 4e9569e81..b58d59be4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,13 @@ before_script: script: ## PHP_CodeSniffer - - ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n + ## Custom xml is used until namespaces implemented. Use PSR2 after that + - ./vendor/bin/phpcs src/ tests/ --standard=phpcs.xml -n ## PHPUnit - phpunit -c ./ --coverage-text ## PHP Copy/Paste Detector # - php phpcpd.phar src/ ## PHP Mess Detector - # - phpmd Classes/ text codesize,unusedcode,naming,design + # - phpmd src/ text codesize,unusedcode,naming,design ## PHPLOC - php phploc.phar src/ diff --git a/phpcs.xml b/phpcs.xml.dist similarity index 100% rename from phpcs.xml rename to phpcs.xml.dist diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 78f952d31..94af1f744 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -12,18 +12,17 @@ // Define path to application directory defined('APPLICATION_PATH') - || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../Classes')); + || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../src')); // Define path to application tests directory defined('APPLICATION_TESTS_PATH') - || define('APPLICATION_TESTS_PATH', realpath(dirname(__FILE__) )); + || define('APPLICATION_TESTS_PATH', realpath(dirname(__FILE__))); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'ci'); // Register autoloader -if (!defined('PHPPOWERPOINT_ROOT')) -{ +if (!defined('PHPPOWERPOINT_ROOT')) { define('PHPPOWERPOINT_ROOT', APPLICATION_PATH . '/'); } require_once PHPPOWERPOINT_ROOT . 'PHPPowerPoint/Autoloader.php'; From 344adc0b5317c3df00e3e6e4de15192becaac34d Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Wed, 4 Jun 2014 23:37:27 +0700 Subject: [PATCH 2/3] Fix PHPCS XML file --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b58d59be4..27026568b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_script: script: ## PHP_CodeSniffer ## Custom xml is used until namespaces implemented. Use PSR2 after that - - ./vendor/bin/phpcs src/ tests/ --standard=phpcs.xml -n + - ./vendor/bin/phpcs src/ tests/ --standard=phpcs.xml.dist -n ## PHPUnit - phpunit -c ./ --coverage-text ## PHP Copy/Paste Detector From 6f10b98ca4d278620e7b3748c9db3043e14da8f3 Mon Sep 17 00:00:00 2001 From: Ivan Lanin Date: Thu, 5 Jun 2014 00:11:16 +0700 Subject: [PATCH 3/3] Fix: PHPCS can only accept custom ruleset with .xml ext --- .travis.yml | 2 +- phpcs.xml.dist => phpcs.xml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename phpcs.xml.dist => phpcs.xml (100%) diff --git a/.travis.yml b/.travis.yml index 27026568b..b58d59be4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_script: script: ## PHP_CodeSniffer ## Custom xml is used until namespaces implemented. Use PSR2 after that - - ./vendor/bin/phpcs src/ tests/ --standard=phpcs.xml.dist -n + - ./vendor/bin/phpcs src/ tests/ --standard=phpcs.xml -n ## PHPUnit - phpunit -c ./ --coverage-text ## PHP Copy/Paste Detector diff --git a/phpcs.xml.dist b/phpcs.xml similarity index 100% rename from phpcs.xml.dist rename to phpcs.xml