From e2ab3068882e158e873783cbb8fea566eed84303 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 18 Oct 2021 13:40:05 +0200 Subject: [PATCH] Made the tests executable again (#1042). --- composer.json | 7 +++-- composer.lock | 4 +-- phpunit.xml | 31 +++---------------- tests/{phpunit => }/bootstrap.php | 4 +-- .../engine/Api/V1/AuthorizationTest.php | 2 +- .../engine/Api/V1/FilterTest.php | 0 .../engine/Api/V1/MinimizeTest.php | 0 .../engine/Api/V1/PaginationTest.php | 0 .../engine/Api/V1/ResponseTest.php | 0 .../engine/Api/V1/SearchTest.php | 0 .../{phpunit => }/engine/Api/V1/SortTest.php | 0 .../engine/Api/V1/fixtures/admin.json | 0 .../engine/Api/V1/fixtures/appointment.json | 0 .../engine/Api/V1/fixtures/category.json | 0 .../engine/Api/V1/fixtures/customer.json | 0 .../engine/Api/V1/fixtures/provider.json | 0 .../engine/Api/V1/fixtures/secretary.json | 0 .../engine/Api/V1/fixtures/service.json | 0 .../engine/Api/V1/fixtures/setting.json | 0 .../Api/V1/fixtures/unavailability.json | 0 .../Type => engine/Types}/BooleanTest.php | 2 +- .../Type => engine/Types}/DecimalTest.php | 2 +- .../Type => engine/Types}/EmailTest.php | 2 +- .../Type => engine/Types}/IntegerTest.php | 2 +- .../Types}/NonEmptyTextTest.php | 2 +- .../engine/Type => engine/Types}/TextTest.php | 2 +- .../Types}/UnsignedIntegerTest.php | 2 +- .../engine/Type => engine/Types}/UrlTest.php | 2 +- 28 files changed, 22 insertions(+), 42 deletions(-) rename tests/{phpunit => }/bootstrap.php (84%) rename tests/{phpunit => }/engine/Api/V1/AuthorizationTest.php (96%) rename tests/{phpunit => }/engine/Api/V1/FilterTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/MinimizeTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/PaginationTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/ResponseTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/SearchTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/SortTest.php (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/admin.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/appointment.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/category.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/customer.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/provider.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/secretary.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/service.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/setting.json (100%) rename tests/{phpunit => }/engine/Api/V1/fixtures/unavailability.json (100%) rename tests/{phpunit/engine/Type => engine/Types}/BooleanTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/DecimalTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/EmailTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/IntegerTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/NonEmptyTextTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/TextTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/UnsignedIntegerTest.php (97%) rename tests/{phpunit/engine/Type => engine/Types}/UrlTest.php (97%) diff --git a/composer.json b/composer.json index 9faad569..7a226909 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,10 @@ "minimum-stability": "stable", "autoload": { "psr-4": { - "EA\\Engine\\": "engine/" + "EA\\Engine\\": [ + "engine/", + "tests/engine/" + ] } }, "require": { @@ -45,7 +48,7 @@ }, "require-dev": { "roave/security-advisories": "dev-master", - "phpunit/phpunit": "^9" + "phpunit/phpunit": "^9.5" }, "scripts": { "test": "php vendor/bin/phpunit tests" diff --git a/composer.lock b/composer.lock index 16b03a30..afb62e73 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38fd62b1f2842600782427033aa9e826", + "content-hash": "691584c0c433458674bdb8e6b295f10c", "packages": [ { "name": "firebase/php-jwt", @@ -3759,5 +3759,5 @@ "ext-gd": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/phpunit.xml b/phpunit.xml index 84b8d7cf..5fe174f1 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,31 +1,8 @@ - - - src/engine - - +> diff --git a/tests/phpunit/bootstrap.php b/tests/bootstrap.php similarity index 84% rename from tests/phpunit/bootstrap.php rename to tests/bootstrap.php index 40e00a06..d3492010 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/bootstrap.php @@ -13,5 +13,5 @@ // Bootstrap Easy!Appointments PHPUnit Tests -require_once __DIR__ . '/../../config.php'; -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../config.php'; +require_once __DIR__ . '/../vendor/autoload.php'; diff --git a/tests/phpunit/engine/Api/V1/AuthorizationTest.php b/tests/engine/Api/V1/AuthorizationTest.php similarity index 96% rename from tests/phpunit/engine/Api/V1/AuthorizationTest.php rename to tests/engine/Api/V1/AuthorizationTest.php index 84349211..45e2f630 100644 --- a/tests/phpunit/engine/Api/V1/AuthorizationTest.php +++ b/tests/engine/Api/V1/AuthorizationTest.php @@ -13,7 +13,7 @@ namespace EA\Engine\Api\V1; -use EA\Engine\Type\NonEmptyText; +use EA\Engine\Types\NonEmptyText; use PHPUnit\Framework\TestCase; class AuthorizationTest extends TestCase { diff --git a/tests/phpunit/engine/Api/V1/FilterTest.php b/tests/engine/Api/V1/FilterTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/FilterTest.php rename to tests/engine/Api/V1/FilterTest.php diff --git a/tests/phpunit/engine/Api/V1/MinimizeTest.php b/tests/engine/Api/V1/MinimizeTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/MinimizeTest.php rename to tests/engine/Api/V1/MinimizeTest.php diff --git a/tests/phpunit/engine/Api/V1/PaginationTest.php b/tests/engine/Api/V1/PaginationTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/PaginationTest.php rename to tests/engine/Api/V1/PaginationTest.php diff --git a/tests/phpunit/engine/Api/V1/ResponseTest.php b/tests/engine/Api/V1/ResponseTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/ResponseTest.php rename to tests/engine/Api/V1/ResponseTest.php diff --git a/tests/phpunit/engine/Api/V1/SearchTest.php b/tests/engine/Api/V1/SearchTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/SearchTest.php rename to tests/engine/Api/V1/SearchTest.php diff --git a/tests/phpunit/engine/Api/V1/SortTest.php b/tests/engine/Api/V1/SortTest.php similarity index 100% rename from tests/phpunit/engine/Api/V1/SortTest.php rename to tests/engine/Api/V1/SortTest.php diff --git a/tests/phpunit/engine/Api/V1/fixtures/admin.json b/tests/engine/Api/V1/fixtures/admin.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/admin.json rename to tests/engine/Api/V1/fixtures/admin.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/appointment.json b/tests/engine/Api/V1/fixtures/appointment.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/appointment.json rename to tests/engine/Api/V1/fixtures/appointment.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/category.json b/tests/engine/Api/V1/fixtures/category.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/category.json rename to tests/engine/Api/V1/fixtures/category.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/customer.json b/tests/engine/Api/V1/fixtures/customer.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/customer.json rename to tests/engine/Api/V1/fixtures/customer.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/provider.json b/tests/engine/Api/V1/fixtures/provider.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/provider.json rename to tests/engine/Api/V1/fixtures/provider.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/secretary.json b/tests/engine/Api/V1/fixtures/secretary.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/secretary.json rename to tests/engine/Api/V1/fixtures/secretary.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/service.json b/tests/engine/Api/V1/fixtures/service.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/service.json rename to tests/engine/Api/V1/fixtures/service.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/setting.json b/tests/engine/Api/V1/fixtures/setting.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/setting.json rename to tests/engine/Api/V1/fixtures/setting.json diff --git a/tests/phpunit/engine/Api/V1/fixtures/unavailability.json b/tests/engine/Api/V1/fixtures/unavailability.json similarity index 100% rename from tests/phpunit/engine/Api/V1/fixtures/unavailability.json rename to tests/engine/Api/V1/fixtures/unavailability.json diff --git a/tests/phpunit/engine/Type/BooleanTest.php b/tests/engine/Types/BooleanTest.php similarity index 97% rename from tests/phpunit/engine/Type/BooleanTest.php rename to tests/engine/Types/BooleanTest.php index 098fded6..ddad070e 100644 --- a/tests/phpunit/engine/Type/BooleanTest.php +++ b/tests/engine/Types/BooleanTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/DecimalTest.php b/tests/engine/Types/DecimalTest.php similarity index 97% rename from tests/phpunit/engine/Type/DecimalTest.php rename to tests/engine/Types/DecimalTest.php index ab8686e3..aedc4925 100644 --- a/tests/phpunit/engine/Type/DecimalTest.php +++ b/tests/engine/Types/DecimalTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/EmailTest.php b/tests/engine/Types/EmailTest.php similarity index 97% rename from tests/phpunit/engine/Type/EmailTest.php rename to tests/engine/Types/EmailTest.php index 327d6eeb..5672f078 100644 --- a/tests/phpunit/engine/Type/EmailTest.php +++ b/tests/engine/Types/EmailTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/IntegerTest.php b/tests/engine/Types/IntegerTest.php similarity index 97% rename from tests/phpunit/engine/Type/IntegerTest.php rename to tests/engine/Types/IntegerTest.php index 09bba741..0caadcfb 100644 --- a/tests/phpunit/engine/Type/IntegerTest.php +++ b/tests/engine/Types/IntegerTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/NonEmptyTextTest.php b/tests/engine/Types/NonEmptyTextTest.php similarity index 97% rename from tests/phpunit/engine/Type/NonEmptyTextTest.php rename to tests/engine/Types/NonEmptyTextTest.php index 359c0527..bdd85fab 100644 --- a/tests/phpunit/engine/Type/NonEmptyTextTest.php +++ b/tests/engine/Types/NonEmptyTextTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/TextTest.php b/tests/engine/Types/TextTest.php similarity index 97% rename from tests/phpunit/engine/Type/TextTest.php rename to tests/engine/Types/TextTest.php index 3fe9e5aa..e7f9b408 100644 --- a/tests/phpunit/engine/Type/TextTest.php +++ b/tests/engine/Types/TextTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/UnsignedIntegerTest.php b/tests/engine/Types/UnsignedIntegerTest.php similarity index 97% rename from tests/phpunit/engine/Type/UnsignedIntegerTest.php rename to tests/engine/Types/UnsignedIntegerTest.php index 7f369846..c022c120 100644 --- a/tests/phpunit/engine/Type/UnsignedIntegerTest.php +++ b/tests/engine/Types/UnsignedIntegerTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/engine/Type/UrlTest.php b/tests/engine/Types/UrlTest.php similarity index 97% rename from tests/phpunit/engine/Type/UrlTest.php rename to tests/engine/Types/UrlTest.php index 19851c4d..cb9392de 100644 --- a/tests/phpunit/engine/Type/UrlTest.php +++ b/tests/engine/Types/UrlTest.php @@ -11,7 +11,7 @@ * @since v1.2.0 * ---------------------------------------------------------------------------- */ -namespace EA\Engine\Type; +namespace EA\Engine\Types; use PHPUnit\Framework\TestCase;