From 48c53453b9afaf3ebddee09cecb27c2475990385 Mon Sep 17 00:00:00 2001 From: Recca Tsai Date: Tue, 28 Feb 2017 18:45:00 +0800 Subject: [PATCH] style ci --- src/Api.php | 2 +- tests/Action/Api/CancelTransactionActionTest.php | 3 ++- tests/Action/Api/CreateTransactionActionTest.php | 3 ++- tests/Action/Api/GetTransactionDataActionTest.php | 3 ++- tests/Action/Api/RefundTransactionActionTest.php | 3 ++- tests/Action/CancelActionTest.php | 2 +- tests/Action/RefundActionTest.php | 2 +- tests/Action/SyncActionTest.php | 2 +- tests/EnrypterTest.php | 2 +- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Api.php b/src/Api.php index c44b1d7..ddfe79e 100644 --- a/src/Api.php +++ b/src/Api.php @@ -48,7 +48,7 @@ public function __construct(array $options, HttpClientInterface $client, Message */ protected function doRequest(array $fields, $type = 'sync') { - $request = $this->messageFactory->createRequest('POST', $this->getApiEndpoint($type), [ + $request = $this->messageFactory->createRequest('POST', $this->getApiEndpoint($type), [ 'Content-Type' => 'application/x-www-form-urlencoded', ], http_build_query($this->encrypter->encryptRequest($fields))); diff --git a/tests/Action/Api/CancelTransactionActionTest.php b/tests/Action/Api/CancelTransactionActionTest.php index cdd2525..6125b47 100644 --- a/tests/Action/Api/CancelTransactionActionTest.php +++ b/tests/Action/Api/CancelTransactionActionTest.php @@ -4,6 +4,7 @@ use Mockery as m; use PHPUnit\Framework\TestCase; +use Payum\Core\Bridge\Spl\ArrayObject; use PayumTW\Esunbank\Request\Api\CancelTransaction; use PayumTW\Esunbank\Action\Api\CancelTransactionAction; @@ -17,7 +18,7 @@ protected function tearDown() public function testExecute() { $action = new CancelTransactionAction(); - $request = new CancelTransaction(['ONO' => 'foo']); + $request = new CancelTransaction(new ArrayObject(['ONO' => 'foo'])); $action->setApi( $api = m::mock('PayumTW\Esunbank\Api') diff --git a/tests/Action/Api/CreateTransactionActionTest.php b/tests/Action/Api/CreateTransactionActionTest.php index cc30623..d0ea963 100644 --- a/tests/Action/Api/CreateTransactionActionTest.php +++ b/tests/Action/Api/CreateTransactionActionTest.php @@ -4,6 +4,7 @@ use Mockery as m; use PHPUnit\Framework\TestCase; +use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Reply\HttpPostRedirect; use PayumTW\Esunbank\Request\Api\CreateTransaction; use PayumTW\Esunbank\Action\Api\CreateTransactionAction; @@ -18,7 +19,7 @@ protected function tearDown() public function testExecute() { $action = new CreateTransactionAction(); - $request = new CreateTransaction([]); + $request = new CreateTransaction(new ArrayObject([])); $action->setApi( $api = m::mock('PayumTW\Esunbank\Api') diff --git a/tests/Action/Api/GetTransactionDataActionTest.php b/tests/Action/Api/GetTransactionDataActionTest.php index 07f0608..07dfeec 100644 --- a/tests/Action/Api/GetTransactionDataActionTest.php +++ b/tests/Action/Api/GetTransactionDataActionTest.php @@ -4,6 +4,7 @@ use Mockery as m; use PHPUnit\Framework\TestCase; +use Payum\Core\Bridge\Spl\ArrayObject; use PayumTW\Esunbank\Request\Api\GetTransactionData; use PayumTW\Esunbank\Action\Api\GetTransactionDataAction; @@ -17,7 +18,7 @@ protected function tearDown() public function testExecute() { $action = new GetTransactionDataAction(); - $request = new GetTransactionData([]); + $request = new GetTransactionData(new ArrayObject([])); $action->setApi( $api = m::mock('PayumTW\Esunbank\Api') diff --git a/tests/Action/Api/RefundTransactionActionTest.php b/tests/Action/Api/RefundTransactionActionTest.php index af343bd..858e326 100644 --- a/tests/Action/Api/RefundTransactionActionTest.php +++ b/tests/Action/Api/RefundTransactionActionTest.php @@ -4,6 +4,7 @@ use Mockery as m; use PHPUnit\Framework\TestCase; +use Payum\Core\Bridge\Spl\ArrayObject; use PayumTW\Esunbank\Request\Api\RefundTransaction; use PayumTW\Esunbank\Action\Api\RefundTransactionAction; @@ -17,7 +18,7 @@ protected function tearDown() public function testExecute() { $action = new RefundTransactionAction(); - $request = new RefundTransaction(['ONO' => 'foo']); + $request = new RefundTransaction(new ArrayObject(['ONO' => 'foo'])); $action->setApi( $api = m::mock('PayumTW\Esunbank\Api') diff --git a/tests/Action/CancelActionTest.php b/tests/Action/CancelActionTest.php index b7294df..c2e01f7 100644 --- a/tests/Action/CancelActionTest.php +++ b/tests/Action/CancelActionTest.php @@ -3,8 +3,8 @@ namespace PayumTW\Esunbank\Tests; use Mockery as m; -use PHPUnit\Framework\TestCase; use Payum\Core\Request\Cancel; +use PHPUnit\Framework\TestCase; use PayumTW\Esunbank\Action\CancelAction; class CancelActionTest extends TestCase diff --git a/tests/Action/RefundActionTest.php b/tests/Action/RefundActionTest.php index 9daa7ef..67eeda8 100644 --- a/tests/Action/RefundActionTest.php +++ b/tests/Action/RefundActionTest.php @@ -3,8 +3,8 @@ namespace PayumTW\Esunbank\Tests; use Mockery as m; -use PHPUnit\Framework\TestCase; use Payum\Core\Request\Refund; +use PHPUnit\Framework\TestCase; use PayumTW\Esunbank\Action\RefundAction; class RefundActionTest extends TestCase diff --git a/tests/Action/SyncActionTest.php b/tests/Action/SyncActionTest.php index 81c6250..89f62f7 100644 --- a/tests/Action/SyncActionTest.php +++ b/tests/Action/SyncActionTest.php @@ -3,8 +3,8 @@ namespace PayumTW\Esunbank\Tests; use Mockery as m; -use PHPUnit\Framework\TestCase; use Payum\Core\Request\Sync; +use PHPUnit\Framework\TestCase; use PayumTW\Esunbank\Action\SyncAction; class SyncActionTest extends TestCase diff --git a/tests/EnrypterTest.php b/tests/EnrypterTest.php index e91b48c..ceef382 100644 --- a/tests/EnrypterTest.php +++ b/tests/EnrypterTest.php @@ -3,8 +3,8 @@ namespace PayumTW\Esunbank\Tests; use Mockery as m; -use PHPUnit\Framework\TestCase; use PayumTW\Esunbank\Encrypter; +use PHPUnit\Framework\TestCase; class EnrypterTest extends TestCase {