Skip to content

Commit

Permalink
Updated to fabpot/goutte ^3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
karser committed Feb 11, 2020
1 parent 031fc5a commit 0fda944
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions Tests/Functional/AbstractSaferpayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Payum\Core\Storage\StorageInterface;
use PHPUnit\Framework\TestCase;
use Symfony\Component\BrowserKit\Exception\BadMethodCallException;
use Symfony\Component\BrowserKit\Response;
use Symfony\Component\DomCrawler\Crawler;

abstract class AbstractSaferpayTest extends TestCase
Expand Down Expand Up @@ -173,8 +174,9 @@ protected function getThroughCheckout(string $url, array $formData, string $acti
} else {
$this->client->submitForm('SubmitToNext', $formData);
}
/** @var Response $response */
$response = $this->client->getResponse();
if ($response->getStatus() === 302) {
if ($response->getStatusCode() === 302) {
$location = $response->getHeader('Location');
if (0 === strpos($location, self::HOST)) {
return $location;
Expand All @@ -184,28 +186,28 @@ protected function getThroughCheckout(string $url, array $formData, string $acti
}

if (false !== strpos($this->client->getCrawler()->getUri(), '/VT2/mpp/PaymentDataEntry/Index')) {
self::assertSame(200, $this->client->getResponse()->getStatus());
self::assertSame(200, $this->client->getResponse()->getStatusCode());
$this->client->submitForm( $action === 'submit' ? 'Buy' : 'Cancel');
self::assertSame(302, $this->client->getResponse()->getStatus());
self::assertSame(302, $this->client->getResponse()->getStatusCode());
$this->client->followRedirect();
}
if (
false !== strpos($this->client->getCrawler()->getUri(), '/VT2/mpp/ThreeDS/Index')
|| false !== strpos($this->client->getCrawler()->getUri(), '/VT2/api/ThreeDs')
) {
self::assertSame(200, $this->client->getResponse()->getStatus());
self::assertSame(200, $this->client->getResponse()->getStatusCode());
$this->submitForm('[type="submit"]');
self::assertSame(200, $this->client->getResponse()->getStatus());
self::assertSame(200, $this->client->getResponse()->getStatusCode());

$this->client->submitForm($action === 'submit' ? 'Submit' : 'Cancel');
self::assertSame(200, $this->client->getResponse()->getStatus());
self::assertSame(200, $this->client->getResponse()->getStatusCode());

$this->client->submitForm('Submit');
self::assertSame(200, $this->client->getResponse()->getStatus());
self::assertSame(200, $this->client->getResponse()->getStatusCode());
$this->clickLink('a.btn-next');

$response = $this->client->getResponse();
self::assertSame(302, $response->getStatus());
self::assertSame(302, $response->getStatusCode());
$location = $response->getHeader('Location');
if (0 === strpos($location, self::HOST)) {
return $location;
Expand All @@ -216,7 +218,7 @@ protected function getThroughCheckout(string $url, array $formData, string $acti
$this->client->submitForm('Cancel');

$response = $this->client->getResponse();
self::assertSame(302, $response->getStatus());
self::assertSame(302, $response->getStatusCode());
$location = $response->getHeader('Location');
if (0 === strpos($location, self::HOST)) {
return $location;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"payum/core": "^1.5"
},
"require-dev": {
"fabpot/goutte": "^3.2,<3.3",
"fabpot/goutte": "^3.3",
"php-http/guzzle6-adapter": "^2.0",
"phpunit/phpunit": "^5.7"
},
Expand Down

0 comments on commit 0fda944

Please sign in to comment.