diff --git a/.editorconfig b/.editorconfig index d870f04..7c45f51 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,7 +15,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{bower.json,package.json,composer.json,karma.conf.js,CONTRIBUTING.md,.travis.yml}] +[{bower.json,package.json,composer.json,karma.conf.js,CONTRIBUTING.md,.travis.yml,*.yml}] indent_size = 2 [*.md] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93a82fb..9613198 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,12 +21,21 @@ jobs: php-version: ${{ matrix.php-versions }} coverage: xdebug - name: Install dependencies - run: composer install --prefer-dist --no-interaction $COMPOSER_ARGS + if: matrix.php-versions != '7.4' + run: composer install --prefer-dist --no-interaction + - name: Install dependencies + if: matrix.php-versions == '7.4' + run: composer install --prefer-dist --no-interaction --ignore-platform-reqs - name: PHP Code Sniffer + if: matrix.php-versions == '7.2' run: vendor/bin/phpcs --report=full --extensions=php -p --standard=phpcs.xml ./src ./tests - name: PHP Mess Detector + if: matrix.php-versions == '7.2' run: vendor/bin/phpmd ./src text phpmd.xml - name: PHP Unit Tests run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml - name: Send to coveralls run: php vendor/bin/php-coveralls -v + env: + COVERALLS_RUN_LOCALLY: 1 + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/tests/EE/EstcardTest.php b/tests/EE/EstcardTest.php index 6daab56..dc22f9e 100644 --- a/tests/EE/EstcardTest.php +++ b/tests/EE/EstcardTest.php @@ -99,6 +99,18 @@ public function testGetPaymentRequest() $this->assertEquals($this->requestUrl, $request->getRequestUrl()); } + /** + * Test for correctly generated request data. + */ + public function testGetPaymentRequestWithoutMessage() + { + $request = $this->bank->getPaymentRequest($this->orderId, $this->amount, '', $this->language, $this->currency, [], $this->timezone); + + unset($this->expectedData['additionalinfo']); + $this->expectedData['mac'] = 'aaacb942dd3512d915224d244c20862457284e72587057d182ee1ee1b6da1082b43632cf9a9138144f52b48edc6fe8cdeb2193320f7a651c670c3550c92ae619c8fd33713f313d8c88241ec8322c78831bb818715eee3584ed612891ea4ce7a31398d280aa7b878907a7f6a2915629a4d369ddd2b1c0b56ad8dec19f5fafb35f'; + $this->assertEquals($this->expectedData, $request->getRequestData()); + } + /** * Test successful payment response. */