-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
91 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Model\Mapper; | ||
|
||
use Iyzipay\Model\ProtectedOverlayScript; | ||
|
||
class ProtectedOverlayScriptMapper extends IyzipayResourceMapper | ||
{ | ||
public static function create($rawResult = null) | ||
{ | ||
return new ProtectedOverlayScriptMapper($rawResult); | ||
} | ||
|
||
public function mapProtectedOverlayScriptFrom(ProtectedOverlayScript $protectedOverlayScript, $jsonObject) | ||
{ | ||
parent::mapResourceFrom($protectedOverlayScript, $jsonObject); | ||
|
||
if (isset($jsonObject->protectedShopId)) { | ||
$protectedOverlayScript->setProtectedShopId($jsonObject->protectedShopId); | ||
} | ||
if (isset($jsonObject->overlayScript)) { | ||
$protectedOverlayScript->setOverlayScript($jsonObject->overlayScript); | ||
} | ||
return $protectedOverlayScript; | ||
} | ||
|
||
public function mapProtectedOverlayScript(ProtectedOverlayScript $protectedOverlayScript) | ||
{ | ||
return $this->mapProtectedOverlayScriptFrom($protectedOverlayScript, $this->jsonObject); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
tests/Iyzipay/Tests/Model/Mapper/ProtectedOverlayScriptMapperTest.php
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,32 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Tests\Model\Mapper; | ||
|
||
use Iyzipay\Model\ProtectedOverlayScript; | ||
use Iyzipay\Model\Locale; | ||
use Iyzipay\Model\Mapper\ProtectedOverlayScriptMapper; | ||
use Iyzipay\Model\Status; | ||
use Iyzipay\Tests\TestCase; | ||
|
||
class ProtectedOverlayScriptMapperTest extends TestCase | ||
{ | ||
public function test_should_map_protected_Overlay_script_mapper() | ||
{ | ||
$json = $this->retrieveJsonFile("retrieve-protected-overlay-script.json"); | ||
|
||
$protectedOverlayScript = ProtectedOverlayScriptMapper::create($json)->jsonDecode()->mapProtectedOverlayScript(new ProtectedOverlayScript()); | ||
|
||
$this->assertNotEmpty($protectedOverlayScript); | ||
$this->assertEquals(Status::FAILURE, $protectedOverlayScript->getStatus()); | ||
$this->assertEquals("10000", $protectedOverlayScript->getErrorCode()); | ||
$this->assertEquals("error message", $protectedOverlayScript->getErrorMessage()); | ||
$this->assertEquals("ERROR_GROUP", $protectedOverlayScript->getErrorGroup()); | ||
$this->assertEquals(Locale::TR, $protectedOverlayScript->getLocale()); | ||
$this->assertEquals("1458545234852", $protectedOverlayScript->getSystemTime()); | ||
$this->assertEquals("123456", $protectedOverlayScript->getConversationId()); | ||
$this->assertJson($protectedOverlayScript->getRawResult()); | ||
$this->assertJsonStringEqualsJsonString($json, $protectedOverlayScript->getRawResult()); | ||
$this->assertEquals("protected shop id", $protectedOverlayScript->getProtectedShopId()); | ||
$this->assertEquals("overlay script", $protectedOverlayScript->getOverlayScript()); | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
tests/Iyzipay/Tests/Model/Mapper/ProtectedOverleyScriptMapperTest.php
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
<?php | ||
|
||
namespace Iyzipay\Tests\Model; | ||
|
||
use Iyzipay\Model\ProtectedOverlayScript; | ||
use Iyzipay\Request\RetrieveProtectedOverlayScriptRequest; | ||
use Iyzipay\Tests\IyzipayResourceTestCase; | ||
|
||
class ProtectedOverlayScriptTest extends IyzipayResourceTestCase | ||
{ | ||
public function test_should_retrieve_protected_Overlay_script() | ||
{ | ||
$this->expectHttpPost(); | ||
|
||
$protectedOverlayScript = ProtectedOverlayScript::retrieve(new RetrieveProtectedOverlayScriptRequest(), $this->options); | ||
|
||
$this->verifyResource($protectedOverlayScript); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.