diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 72f7beb..5e1634a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -79,7 +79,7 @@ code coverage of the fixed bugs and the new features. To run the existing unit tests, run this command: ```bash -vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/ +vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml tests/Unit/ ``` ### Running the integration tests @@ -100,7 +100,7 @@ When running the integration tests, you will need to specify the database name and access credentials on the command line (in the same line): ```bash -PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/ +PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml tests/Integration/ ``` @@ -116,7 +116,7 @@ We will only merge pull requests that follow the project's coding style. Please check your code with the provided PHP_CodeSniffer standard: ```bash -vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/ +vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ tests/ ``` Please also check the code structure using PHPMD: @@ -128,13 +128,13 @@ vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/ And also please run the static code analysis: ```bash -vendor/bin/phpstan analyse -l 5 Classes/ Tests/ +vendor/bin/phpstan analyse -l 5 Classes/ tests/ ``` You can also run all code style checks using one long line from a bash shell: ```bash -find Classes/ Tests/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l && vendor/bin/phpstan analyse -l 5 Classes/ Tests/ && vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/ +find Classes/ tests/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l && vendor/bin/phpstan analyse -l 5 Classes/ tests/ && vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ tests/ ``` This will execute all tests except for the unit tests and the integration diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3e2493c..13650be 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ Are your changes covered with unit tests, and do they not break anything? You can run the existing unit tests using this command: - vendor/bin/phpunit Tests/ + vendor/bin/phpunit tests/ ### Code style @@ -22,7 +22,7 @@ style? You can check for this using this command: - vendor/bin/phpcs --standard=PSR2 Classes/ Tests/ + vendor/bin/phpcs --standard=PSR2 Classes/ tests/ ### Other Information diff --git a/.travis.yml b/.travis.yml index 9c31e87..5fbc25a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,22 +61,22 @@ script: - > echo; echo "Linting all PHP files"; - find Classes/ Tests/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; + find Classes/ tests/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; - > echo; echo "Running the unit tests"; - vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/; + vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml tests/Unit/; - > echo; echo "Running the integration tests"; - vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/; + vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml tests/Integration/; - > echo; echo "Running the static analysis"; - vendor/bin/phpstan analyse -l 5 Classes/ Tests/; + vendor/bin/phpstan analyse -l 5 Classes/ tests/; - > echo; @@ -86,4 +86,4 @@ script: - > echo; echo "Running PHP_CodeSniffer"; - vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/; + vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ tests/; diff --git a/CHANGELOG.md b/CHANGELOG.md index a046df0..e3cfba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - REST action for getting all subscribers for a list (#83) ### Changed +- Adopt more of the default Symfony project structure (#92) ### Deprecated diff --git a/composer.json b/composer.json index 3f16dd3..ebd0970 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ }, "autoload-dev": { "psr-4": { - "PhpList\\RestBundle\\Tests\\": "Tests/" + "PhpList\\RestBundle\\Tests\\": "tests/" } }, "scripts": { @@ -84,7 +84,7 @@ "symfony-bin-dir": "bin", "symfony-var-dir": "var", "symfony-web-dir": "web", - "symfony-tests-dir": "Tests", + "symfony-tests-dir": "tests", "phplist/phplist4-core": { "bundles": [ "FOS\\RestBundle\\FOSRestBundle", diff --git a/Tests/Integration/Composer/ScriptsTest.php b/tests/Integration/Composer/ScriptsTest.php similarity index 100% rename from Tests/Integration/Composer/ScriptsTest.php rename to tests/Integration/Composer/ScriptsTest.php diff --git a/Tests/Integration/Controller/AbstractControllerTest.php b/tests/Integration/Controller/AbstractControllerTest.php similarity index 100% rename from Tests/Integration/Controller/AbstractControllerTest.php rename to tests/Integration/Controller/AbstractControllerTest.php diff --git a/Tests/Integration/Controller/Fixtures/Administrator.csv b/tests/Integration/Controller/Fixtures/Administrator.csv similarity index 100% rename from Tests/Integration/Controller/Fixtures/Administrator.csv rename to tests/Integration/Controller/Fixtures/Administrator.csv diff --git a/Tests/Integration/Controller/Fixtures/AdministratorToken.csv b/tests/Integration/Controller/Fixtures/AdministratorToken.csv similarity index 100% rename from Tests/Integration/Controller/Fixtures/AdministratorToken.csv rename to tests/Integration/Controller/Fixtures/AdministratorToken.csv diff --git a/Tests/Integration/Controller/Fixtures/Subscriber.csv b/tests/Integration/Controller/Fixtures/Subscriber.csv similarity index 100% rename from Tests/Integration/Controller/Fixtures/Subscriber.csv rename to tests/Integration/Controller/Fixtures/Subscriber.csv diff --git a/Tests/Integration/Controller/Fixtures/SubscriberList.csv b/tests/Integration/Controller/Fixtures/SubscriberList.csv similarity index 100% rename from Tests/Integration/Controller/Fixtures/SubscriberList.csv rename to tests/Integration/Controller/Fixtures/SubscriberList.csv diff --git a/Tests/Integration/Controller/Fixtures/Subscription.csv b/tests/Integration/Controller/Fixtures/Subscription.csv similarity index 100% rename from Tests/Integration/Controller/Fixtures/Subscription.csv rename to tests/Integration/Controller/Fixtures/Subscription.csv diff --git a/Tests/Integration/Controller/ListControllerTest.php b/tests/Integration/Controller/ListControllerTest.php similarity index 100% rename from Tests/Integration/Controller/ListControllerTest.php rename to tests/Integration/Controller/ListControllerTest.php diff --git a/Tests/Integration/Controller/SessionControllerTest.php b/tests/Integration/Controller/SessionControllerTest.php similarity index 100% rename from Tests/Integration/Controller/SessionControllerTest.php rename to tests/Integration/Controller/SessionControllerTest.php diff --git a/Tests/Integration/Controller/SubscriberControllerTest.php b/tests/Integration/Controller/SubscriberControllerTest.php similarity index 100% rename from Tests/Integration/Controller/SubscriberControllerTest.php rename to tests/Integration/Controller/SubscriberControllerTest.php diff --git a/Tests/Integration/Routing/RoutingTest.php b/tests/Integration/Routing/RoutingTest.php similarity index 100% rename from Tests/Integration/Routing/RoutingTest.php rename to tests/Integration/Routing/RoutingTest.php diff --git a/Tests/System/Controller/SessionControllerTest.php b/tests/System/Controller/SessionControllerTest.php similarity index 100% rename from Tests/System/Controller/SessionControllerTest.php rename to tests/System/Controller/SessionControllerTest.php diff --git a/Tests/Unit/PhpListRestBundleTest.php b/tests/Unit/PhpListRestBundleTest.php similarity index 100% rename from Tests/Unit/PhpListRestBundleTest.php rename to tests/Unit/PhpListRestBundleTest.php