diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c32dcfc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +/tests export-ignore +.gitattributes export-ignore +.gitignore export-ignore +azure-pipelines.yml export-ignore +phpcs.ruleset.xml export-ignore diff --git a/.gitignore b/.gitignore index 57d5c06..0691e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .idea .phpunit.result.cache vendor -src/Test/phpunit_integration.xml \ No newline at end of file +tests/phpunit_integration.xml \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a2427c8..6687308 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ steps: - script: ./vendor/bin/phpmd ./src/ ansi controversial,naming --exclude /Model/* displayName: 'Run PHP mess detector for other rulesets' -- script: ./vendor/bin/phpunit --no-configuration --log-junit $(System.DefaultWorkingDirectory)/junit-unit-report.xml ./src/Test/Unit/ +- script: ./vendor/bin/phpunit --no-configuration --log-junit $(System.DefaultWorkingDirectory)/junit-unit-report.xml ./tests/Unit/ displayName: 'Run unit tests with phpunit' - task: PublishTestResults@2 @@ -52,9 +52,9 @@ steps: - script: | echo Linking $(integrationTestsConfig.secureFilePath) to the integration tests directory... - sudo ln -s -t $(System.DefaultWorkingDirectory)/src/Test $(integrationTestsConfig.secureFilePath) + sudo ln -s -t $(System.DefaultWorkingDirectory)/tests $(integrationTestsConfig.secureFilePath) -- script: ./vendor/bin/phpunit --configuration ./src/Test/phpunit_integration.xml --log-junit $(System.DefaultWorkingDirectory)/junit-integration-report.xml +- script: ./vendor/bin/phpunit --configuration ./tests/phpunit_integration.xml --log-junit $(System.DefaultWorkingDirectory)/junit-integration-report.xml displayName: 'Run integration tests with phpunit' - task: PublishTestResults@2 diff --git a/composer.json b/composer.json index 3e28da5..9609905 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "michalbiarda/shipx-php-sdk", - "version": "1.0.0-alpha6", + "description": "PHP SDK for Inpost ShipX API", + "version": "1.0.0-alpha7", "authors": [ { "email": "m.biarda@gmail.com", @@ -22,6 +23,11 @@ "MB\\ShipXSDK\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "MB\\ShipXSDK\\Test\\": "tests/" + } + }, "license": "Beerware", "require-dev": { "phpunit/phpunit": "^9.4", diff --git a/src/Test/Integration/Client/AddressBookResourceTest.php b/tests/Integration/Client/AddressBookResourceTest.php similarity index 100% rename from src/Test/Integration/Client/AddressBookResourceTest.php rename to tests/Integration/Client/AddressBookResourceTest.php diff --git a/src/Test/Integration/Client/ClientFactory.php b/tests/Integration/Client/ClientFactory.php similarity index 100% rename from src/Test/Integration/Client/ClientFactory.php rename to tests/Integration/Client/ClientFactory.php diff --git a/src/Test/Integration/Client/MpkResourceTest.php b/tests/Integration/Client/MpkResourceTest.php similarity index 100% rename from src/Test/Integration/Client/MpkResourceTest.php rename to tests/Integration/Client/MpkResourceTest.php diff --git a/src/Test/Integration/Client/OrganizationResourceTest.php b/tests/Integration/Client/OrganizationResourceTest.php similarity index 100% rename from src/Test/Integration/Client/OrganizationResourceTest.php rename to tests/Integration/Client/OrganizationResourceTest.php diff --git a/src/Test/Integration/Client/PointResourceTest.php b/tests/Integration/Client/PointResourceTest.php similarity index 100% rename from src/Test/Integration/Client/PointResourceTest.php rename to tests/Integration/Client/PointResourceTest.php diff --git a/src/Test/Integration/Client/ReportResourceTest.php b/tests/Integration/Client/ReportResourceTest.php similarity index 100% rename from src/Test/Integration/Client/ReportResourceTest.php rename to tests/Integration/Client/ReportResourceTest.php diff --git a/src/Test/Integration/Client/SendingMethodResourceTest.php b/tests/Integration/Client/SendingMethodResourceTest.php similarity index 100% rename from src/Test/Integration/Client/SendingMethodResourceTest.php rename to tests/Integration/Client/SendingMethodResourceTest.php diff --git a/src/Test/Integration/Client/ServiceResourceTest.php b/tests/Integration/Client/ServiceResourceTest.php similarity index 100% rename from src/Test/Integration/Client/ServiceResourceTest.php rename to tests/Integration/Client/ServiceResourceTest.php diff --git a/src/Test/Integration/Client/ShipmentResourceTest.php b/tests/Integration/Client/ShipmentResourceTest.php similarity index 100% rename from src/Test/Integration/Client/ShipmentResourceTest.php rename to tests/Integration/Client/ShipmentResourceTest.php diff --git a/src/Test/Integration/Client/StatusResourceTest.php b/tests/Integration/Client/StatusResourceTest.php similarity index 100% rename from src/Test/Integration/Client/StatusResourceTest.php rename to tests/Integration/Client/StatusResourceTest.php diff --git a/src/Test/Integration/Client/TestCase.php b/tests/Integration/Client/TestCase.php similarity index 100% rename from src/Test/Integration/Client/TestCase.php rename to tests/Integration/Client/TestCase.php diff --git a/src/Test/Integration/Client/TrackingResourceTest.php b/tests/Integration/Client/TrackingResourceTest.php similarity index 100% rename from src/Test/Integration/Client/TrackingResourceTest.php rename to tests/Integration/Client/TrackingResourceTest.php diff --git a/src/Test/Integration/Config.php b/tests/Integration/Config.php similarity index 100% rename from src/Test/Integration/Config.php rename to tests/Integration/Config.php diff --git a/src/Test/Unit/Request/RequestFactoryTest.php b/tests/Unit/Request/RequestFactoryTest.php similarity index 100% rename from src/Test/Unit/Request/RequestFactoryTest.php rename to tests/Unit/Request/RequestFactoryTest.php diff --git a/src/Test/Unit/Response/HttpResponseProcessorTest.php b/tests/Unit/Response/HttpResponseProcessorTest.php similarity index 100% rename from src/Test/Unit/Response/HttpResponseProcessorTest.php rename to tests/Unit/Response/HttpResponseProcessorTest.php diff --git a/src/Test/Unit/Response/ResponseFactoryTest.php b/tests/Unit/Response/ResponseFactoryTest.php similarity index 100% rename from src/Test/Unit/Response/ResponseFactoryTest.php rename to tests/Unit/Response/ResponseFactoryTest.php diff --git a/src/Test/Unit/Stub/HttpResponse/AbstractResponse.php b/tests/Unit/Stub/HttpResponse/AbstractResponse.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/AbstractResponse.php rename to tests/Unit/Stub/HttpResponse/AbstractResponse.php diff --git a/src/Test/Unit/Stub/HttpResponse/AbstractStreamWithContents.php b/tests/Unit/Stub/HttpResponse/AbstractStreamWithContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/AbstractStreamWithContents.php rename to tests/Unit/Stub/HttpResponse/AbstractStreamWithContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/ErrorResponse.php b/tests/Unit/Stub/HttpResponse/ErrorResponse.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/ErrorResponse.php rename to tests/Unit/Stub/HttpResponse/ErrorResponse.php diff --git a/src/Test/Unit/Stub/HttpResponse/NoContentResponse.php b/tests/Unit/Stub/HttpResponse/NoContentResponse.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/NoContentResponse.php rename to tests/Unit/Stub/HttpResponse/NoContentResponse.php diff --git a/src/Test/Unit/Stub/HttpResponse/OkResponse.php b/tests/Unit/Stub/HttpResponse/OkResponse.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/OkResponse.php rename to tests/Unit/Stub/HttpResponse/OkResponse.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200.php b/tests/Unit/Stub/HttpResponse/Response200.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200.php rename to tests/Unit/Stub/HttpResponse/Response200.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200WithBinaryBody.php b/tests/Unit/Stub/HttpResponse/Response200WithBinaryBody.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200WithBinaryBody.php rename to tests/Unit/Stub/HttpResponse/Response200WithBinaryBody.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200WithErrorData.php b/tests/Unit/Stub/HttpResponse/Response200WithErrorData.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200WithErrorData.php rename to tests/Unit/Stub/HttpResponse/Response200WithErrorData.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200WithJsonArrayBody.php b/tests/Unit/Stub/HttpResponse/Response200WithJsonArrayBody.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200WithJsonArrayBody.php rename to tests/Unit/Stub/HttpResponse/Response200WithJsonArrayBody.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200WithoutJsonBody.php b/tests/Unit/Stub/HttpResponse/Response200WithoutJsonBody.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200WithoutJsonBody.php rename to tests/Unit/Stub/HttpResponse/Response200WithoutJsonBody.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response200WithoutJsonHeader.php b/tests/Unit/Stub/HttpResponse/Response200WithoutJsonHeader.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response200WithoutJsonHeader.php rename to tests/Unit/Stub/HttpResponse/Response200WithoutJsonHeader.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response400.php b/tests/Unit/Stub/HttpResponse/Response400.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response400.php rename to tests/Unit/Stub/HttpResponse/Response400.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response400WithoutJsonBody.php b/tests/Unit/Stub/HttpResponse/Response400WithoutJsonBody.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response400WithoutJsonBody.php rename to tests/Unit/Stub/HttpResponse/Response400WithoutJsonBody.php diff --git a/src/Test/Unit/Stub/HttpResponse/Response400WithoutJsonHeader.php b/tests/Unit/Stub/HttpResponse/Response400WithoutJsonHeader.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/Response400WithoutJsonHeader.php rename to tests/Unit/Stub/HttpResponse/Response400WithoutJsonHeader.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithBinaryContents.php b/tests/Unit/Stub/HttpResponse/StreamWithBinaryContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithBinaryContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithBinaryContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithErrorContents.php b/tests/Unit/Stub/HttpResponse/StreamWithErrorContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithErrorContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithErrorContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithJsonArrayContents.php b/tests/Unit/Stub/HttpResponse/StreamWithJsonArrayContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithJsonArrayContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithJsonArrayContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithJsonFooBarContents.php b/tests/Unit/Stub/HttpResponse/StreamWithJsonFooBarContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithJsonFooBarContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithJsonFooBarContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithSimpleErrorContents.php b/tests/Unit/Stub/HttpResponse/StreamWithSimpleErrorContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithSimpleErrorContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithSimpleErrorContents.php diff --git a/src/Test/Unit/Stub/HttpResponse/StreamWithoutContents.php b/tests/Unit/Stub/HttpResponse/StreamWithoutContents.php similarity index 100% rename from src/Test/Unit/Stub/HttpResponse/StreamWithoutContents.php rename to tests/Unit/Stub/HttpResponse/StreamWithoutContents.php diff --git a/src/Test/Unit/Stub/MethodWithArrayResponsePayload.php b/tests/Unit/Stub/MethodWithArrayResponsePayload.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithArrayResponsePayload.php rename to tests/Unit/Stub/MethodWithArrayResponsePayload.php diff --git a/src/Test/Unit/Stub/MethodWithAuthorizationInterface.php b/tests/Unit/Stub/MethodWithAuthorizationInterface.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithAuthorizationInterface.php rename to tests/Unit/Stub/MethodWithAuthorizationInterface.php diff --git a/src/Test/Unit/Stub/MethodWithAuthorizationNeeded.php b/tests/Unit/Stub/MethodWithAuthorizationNeeded.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithAuthorizationNeeded.php rename to tests/Unit/Stub/MethodWithAuthorizationNeeded.php diff --git a/src/Test/Unit/Stub/MethodWithBinaryResponse.php b/tests/Unit/Stub/MethodWithBinaryResponse.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithBinaryResponse.php rename to tests/Unit/Stub/MethodWithBinaryResponse.php diff --git a/src/Test/Unit/Stub/MethodWithFilterableResults.php b/tests/Unit/Stub/MethodWithFilterableResults.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithFilterableResults.php rename to tests/Unit/Stub/MethodWithFilterableResults.php diff --git a/src/Test/Unit/Stub/MethodWithJsonRequestInterface.php b/tests/Unit/Stub/MethodWithJsonRequestInterface.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithJsonRequestInterface.php rename to tests/Unit/Stub/MethodWithJsonRequestInterface.php diff --git a/src/Test/Unit/Stub/MethodWithJsonResponseInterface.php b/tests/Unit/Stub/MethodWithJsonResponseInterface.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithJsonResponseInterface.php rename to tests/Unit/Stub/MethodWithJsonResponseInterface.php diff --git a/src/Test/Unit/Stub/MethodWithPaginatedResults.php b/tests/Unit/Stub/MethodWithPaginatedResults.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithPaginatedResults.php rename to tests/Unit/Stub/MethodWithPaginatedResults.php diff --git a/src/Test/Unit/Stub/MethodWithPayload.php b/tests/Unit/Stub/MethodWithPayload.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithPayload.php rename to tests/Unit/Stub/MethodWithPayload.php diff --git a/src/Test/Unit/Stub/MethodWithQueryParams.php b/tests/Unit/Stub/MethodWithQueryParams.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithQueryParams.php rename to tests/Unit/Stub/MethodWithQueryParams.php diff --git a/src/Test/Unit/Stub/MethodWithResponsePayload.php b/tests/Unit/Stub/MethodWithResponsePayload.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithResponsePayload.php rename to tests/Unit/Stub/MethodWithResponsePayload.php diff --git a/src/Test/Unit/Stub/MethodWithSortableResults.php b/tests/Unit/Stub/MethodWithSortableResults.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithSortableResults.php rename to tests/Unit/Stub/MethodWithSortableResults.php diff --git a/src/Test/Unit/Stub/MethodWithUriParams.php b/tests/Unit/Stub/MethodWithUriParams.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithUriParams.php rename to tests/Unit/Stub/MethodWithUriParams.php diff --git a/src/Test/Unit/Stub/MethodWithoutAuthorizationNeeded.php b/tests/Unit/Stub/MethodWithoutAuthorizationNeeded.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithoutAuthorizationNeeded.php rename to tests/Unit/Stub/MethodWithoutAuthorizationNeeded.php diff --git a/src/Test/Unit/Stub/MethodWithoutPayload.php b/tests/Unit/Stub/MethodWithoutPayload.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithoutPayload.php rename to tests/Unit/Stub/MethodWithoutPayload.php diff --git a/src/Test/Unit/Stub/MethodWithoutUriParams.php b/tests/Unit/Stub/MethodWithoutUriParams.php similarity index 100% rename from src/Test/Unit/Stub/MethodWithoutUriParams.php rename to tests/Unit/Stub/MethodWithoutUriParams.php diff --git a/src/Test/Unit/Stub/ModelWithFooBarSimpleProperties.php b/tests/Unit/Stub/ModelWithFooBarSimpleProperties.php similarity index 100% rename from src/Test/Unit/Stub/ModelWithFooBarSimpleProperties.php rename to tests/Unit/Stub/ModelWithFooBarSimpleProperties.php diff --git a/src/Test/Unit/Stub/ModelWithItemsArray.php b/tests/Unit/Stub/ModelWithItemsArray.php similarity index 100% rename from src/Test/Unit/Stub/ModelWithItemsArray.php rename to tests/Unit/Stub/ModelWithItemsArray.php diff --git a/src/Test/Unit/Stub/ProcessorReturningNull.php b/tests/Unit/Stub/ProcessorReturningNull.php similarity index 100% rename from src/Test/Unit/Stub/ProcessorReturningNull.php rename to tests/Unit/Stub/ProcessorReturningNull.php diff --git a/src/Test/Unit/Stub/ProcessorReturningSimpleResponse.php b/tests/Unit/Stub/ProcessorReturningSimpleResponse.php similarity index 100% rename from src/Test/Unit/Stub/ProcessorReturningSimpleResponse.php rename to tests/Unit/Stub/ProcessorReturningSimpleResponse.php diff --git a/src/Test/phpunit_integration.xml.dist b/tests/phpunit_integration.xml.dist similarity index 91% rename from src/Test/phpunit_integration.xml.dist rename to tests/phpunit_integration.xml.dist index 048aef6..dc0174e 100644 --- a/src/Test/phpunit_integration.xml.dist +++ b/tests/phpunit_integration.xml.dist @@ -5,7 +5,7 @@ * See LICENSE.txt for license details. */ --> - + Integration