Skip to content

Commit

Permalink
update tests for php8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Dec 2, 2024
1 parent 5c8f693 commit 25d24ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Tests/Codeception/Acceptance/SofortCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function getOXID(): array
public function _before(AcceptanceTester $I): void
{
parent::_before($I);
$I->resetCookie([]);
$I->resetCookie();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Controller/DispatcherControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testFinalizeTmpOrderExecutesCorrectly()
'OXID' => 'testTmpOrderId',
'TMPORDER' => base64_encode(serialize(['order' => $order]))
];

/** @var DispatcherController $controller */
$controller = $this->getDispatcherControllerPartialMock();

$result = $controller->finalizeTmpOrder($paymentMock, $tmpOrderMock, $tmpData, false);
Expand Down
7 changes: 4 additions & 3 deletions Tests/Unit/Service/FlexibleSerializerOrderTest.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?php

declare(strict_types=1);

namespace OxidSolutionCatalysts\Unzer\Tests\Unit\Service;

use OxidSolutionCatalysts\Unzer\Model\Order;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Application\Model\Order;
use OxidSolutionCatalysts\Unzer\Service\FlexibleSerializer;
use PHPUnit\Framework\TestCase;
use stdClass;

class FlexibleSerializerOrderTest extends TestCase
{
private $flexibleSerializer;
private ?FlexibleSerializer $flexibleSerializer;

protected function setUp(): void
{
Expand Down
4 changes: 4 additions & 0 deletions src/Service/FlexibleSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function restoreOrderFromStrClass(string $serialized): ?Order

$order = $this->getOrderModel();

if (!$unserializedData) {
return $order;
}

foreach (get_object_vars($unserializedData) as $property => $value) {
if (property_exists($order, $property) || method_exists($order, 'setFieldData')) {
if (method_exists($order, 'setFieldData')) {
Expand Down

0 comments on commit 25d24ab

Please sign in to comment.