forked from thephpleague/omnipay-mollie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from MyOnlineStore/merge-upstream
Merge upstream
Showing
5 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace Omnipay\Mollie\Test\Message; | ||
|
||
use GuzzleHttp\Psr7\Request; | ||
use Omnipay\Mollie\Gateway; | ||
use Omnipay\Mollie\Message\Request\CompleteOrderRequest; | ||
use Omnipay\Mollie\Message\Request\CompletePurchaseRequest; | ||
use Omnipay\Mollie\Message\Response\CompleteOrderResponse; | ||
use Omnipay\Mollie\Message\Response\CompletePurchaseResponse; | ||
use Omnipay\Tests\TestCase; | ||
|
||
class AbstractMollieRequestTest extends TestCase | ||
{ | ||
/** | ||
* @var Gateway | ||
*/ | ||
protected $gateway; | ||
|
||
public function setUp() | ||
{ | ||
$this->gateway = new Gateway($this->getHttpClient()); | ||
} | ||
|
||
|
||
public function testVersionString() | ||
{ | ||
$request = $this->gateway->fetchIssuers(); | ||
$request->send(); | ||
|
||
/** @var \Psr\Http\Message\RequestInterface $httpRequest */ | ||
$httpRequest = $this->getMockedRequests()[0]; | ||
|
||
$versionString = 'Omnipay-Mollie/'.Gateway::GATEWAY_VERSION.' PHP/' . phpversion(); | ||
$this->assertEquals($versionString, $httpRequest->getHeaderLine('User-Agent')); | ||
} | ||
|
||
public function testCustomVersionStrings() | ||
{ | ||
$this->gateway->initialize([ | ||
'versionStrings' => ['Acme/6.84'] | ||
]); | ||
$request = $this->gateway->fetchIssuers(); | ||
$request->send(); | ||
|
||
/** @var \Psr\Http\Message\RequestInterface $httpRequest */ | ||
$httpRequest = $this->getMockedRequests()[0]; | ||
|
||
$versionString = 'Omnipay-Mollie/'.Gateway::GATEWAY_VERSION.' PHP/' . phpversion() . ' Acme/6.84'; | ||
$this->assertEquals($versionString, $httpRequest->getHeaderLine('User-Agent')); | ||
} | ||
|
||
public function testAddVersionString() | ||
{ | ||
$this->gateway->addVersionString('Acme/6.84'); | ||
$request = $this->gateway->fetchIssuers(); | ||
$request->send(); | ||
|
||
/** @var \Psr\Http\Message\RequestInterface $httpRequest */ | ||
$httpRequest = $this->getMockedRequests()[0]; | ||
|
||
$versionString = 'Omnipay-Mollie/'.Gateway::GATEWAY_VERSION.' PHP/' . phpversion() . ' Acme/6.84'; | ||
$this->assertEquals($versionString, $httpRequest->getHeaderLine('User-Agent')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters