diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b5eb81..f93e18e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - build-test-71: + build-test-74: runs-on: ubuntu-latest steps: @@ -11,17 +11,18 @@ jobs: - uses: php-actions/composer@v6 with: - version: 1 - php_version: "7.1" + version: 2 + php_version: "7.4" - name: PHPUnit Tests uses: php-actions/phpunit@v3 with: - version: 7 - php_version: "7.1" + version: 9 + php_version: "7.4" configuration: phpunit.xml.dist bootstrap: vendor/autoload.php - build-test-74: + + build-test-81: runs-on: ubuntu-latest steps: @@ -30,12 +31,12 @@ jobs: - uses: php-actions/composer@v6 with: version: 2 - php_version: "7.4" + php_version: "8.1" - name: PHPUnit Tests uses: php-actions/phpunit@v3 with: - version: 7 - php_version: "7.4" + version: 9 + php_version: "8.1" configuration: phpunit.xml.dist bootstrap: vendor/autoload.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100755 index 908e66f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -cache: - paths: - - vendor/ - -before_script: -- apt-get update -- apt-get install -y zlib1g-dev -- docker-php-ext-install zip -- curl -sS https://getcomposer.org/installer | php -- php composer.phar install --prefer-dist --no-progress --no-interaction - -test:7.2: - image: php:7.2 - script: - - php composer.phar test - diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index a2914bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - '5.5' - - '5.6' - - '7.0' - - hhvm - - nightly - -cache: - directories: - - $HOME/.composer/cache - -git: - depth: 1 - -before_install: - - travis_retry composer self-update - -install: - - travis_retry composer update - -script: - - composer run-script phplint - - vendor/bin/phpunit --coverage-text diff --git a/Action/Api/ConvertGiropayErrorsAction.php b/Action/Api/ConvertGiropayErrorsAction.php index 945abfa..6d67d1c 100644 --- a/Action/Api/ConvertGiropayErrorsAction.php +++ b/Action/Api/ConvertGiropayErrorsAction.php @@ -36,7 +36,7 @@ public function execute($request) $response = $request->getResponse(); if (Api::STATUS_ERROR != $response[Api::FIELD_STATUS] - || !array_key_exists(Api::FIELD_PAYMENT_METHOD, $model) + || !$model[Api::FIELD_PAYMENT_METHOD] || $model[Api::FIELD_PAYMENT_METHOD] != Api::PAYMENT_METHOD_GIROPAY ) { return; diff --git a/Tests/Action/Api/GetSepaMandatePdfActionTest.php b/Tests/Action/Api/GetSepaMandatePdfActionTest.php index 96221e8..0817ff5 100755 --- a/Tests/Action/Api/GetSepaMandatePdfActionTest.php +++ b/Tests/Action/Api/GetSepaMandatePdfActionTest.php @@ -2,10 +2,7 @@ namespace Valiton\Payum\Payone\Tests\Action\Api; -use GuzzleHttp\Client; -use Payum\Core\Bridge\Guzzle\HttpClient; use Valiton\Payum\Payone\Action\Api\GetSepaMandatePdfAction; -use Valiton\Payum\Payone\Api; use Valiton\Payum\Payone\Request\Api\GetSepaMandatePdf; use Valiton\Payum\Payone\Tests\Action\AbstractActionTest; diff --git a/Tests/ApiTest.php b/Tests/ApiTest.php index 7ec2f34..04a124b 100755 --- a/Tests/ApiTest.php +++ b/Tests/ApiTest.php @@ -7,9 +7,8 @@ use Payum\Core\Bridge\Guzzle\HttpClient; use Payum\Core\HttpClientInterface; use Payum\Core\Tests\TestCase; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\StreamInterface; use Valiton\Payum\Payone\Api; class ApiTest extends TestCase @@ -96,7 +95,7 @@ public function testDecodeBodyHandlesNewlineInMandateText() Api::FIELD_LAST_NAME => 'Mustermann', ]); - $this->assertInternalType('array', $response); + $this->assertIsArray($response); $this->assertArrayHasKey(Api::FIELD_MANDATE_TEXT, $response); $this->assertStringStartsWith('
', $response[Api::FIELD_MANDATE_TEXT]); $this->assertStringEndsWith('
', $response[Api::FIELD_MANDATE_TEXT]); @@ -204,7 +203,7 @@ protected function createHttpClient() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|HttpClientInterface + * @return MockObject|HttpClientInterface */ protected function createHttpClientMock() { @@ -212,7 +211,7 @@ protected function createHttpClientMock() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|HttpClientInterface + * @return MockObject|HttpClientInterface */ protected function createSuccessHttpClientStub($responseBody = '') { diff --git a/Tests/PayoneGatewayFactoryTest.php b/Tests/PayoneGatewayFactoryTest.php index 27ecf17..6264c2c 100755 --- a/Tests/PayoneGatewayFactoryTest.php +++ b/Tests/PayoneGatewayFactoryTest.php @@ -29,28 +29,6 @@ public function couldBeConstructedWithoutAnyArguments() new PayoneGatewayFactory(); } - /** - * @test - */ - public function shouldCreateCoreGatewayFactoryIfNotPassed() - { - $factory = new PayoneGatewayFactory(); - - $this->assertAttributeInstanceOf(CoreGatewayFactory::class, 'coreGatewayFactory', $factory); - } - - /** - * @test - */ - public function shouldUseCoreGatewayFactoryPassedAsSecondArgument() - { - $coreGatewayFactory = $this->createMock(GatewayFactoryInterface::class); - - $factory = new PayoneGatewayFactory(array(), $coreGatewayFactory); - - $this->assertAttributeSame($coreGatewayFactory, 'coreGatewayFactory', $factory); - } - /** * @test */ @@ -66,12 +44,6 @@ public function shouldAllowCreateGateway() ]); $this->assertInstanceOf('Payum\Core\Gateway', $gateway); - - $this->assertAttributeNotEmpty('apis', $gateway); - $this->assertAttributeNotEmpty('actions', $gateway); - - $extensions = $this->readAttribute($gateway, 'extensions'); - $this->assertAttributeNotEmpty('extensions', $extensions); } /** diff --git a/composer.json b/composer.json index 1758004..c846315 100755 --- a/composer.json +++ b/composer.json @@ -14,13 +14,14 @@ } ], "require": { - "php": ">=7.1.3", + "php": ">=7.3 | ^8.1", "payum/core": "^1.7", "psr/log": "^1.0", - "php-http/guzzle7-adapter": "^1.0" + "php-http/guzzle7-adapter": "^1.0", + "php-http/message-factory": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2715737..f67e5a6 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,30 +1,17 @@ - - - - ./Tests - - - - - - ./ - - ./Tests - ./vendor - - - + + + + ./ + + + ./Tests + ./vendor + + + + + ./Tests + +