improve code

This commit is contained in:
Daniel Seifert 2023-01-28 23:41:39 +01:00 gecommit door Daniel Seifert
bovenliggende cf5c492124
commit 359379c1a0
Getekend door: DanielS
GPG sleutel-ID: 8A7C4C6ED1915C6F
31 gewijzigde bestanden met toevoegingen van 58 en 63 verwijderingen

Bestand weergeven

@ -10,4 +10,4 @@ parameters:
- '#Call to an undefined method OxidEsales\\Eshop\\Core\\Controller\\BaseController::getNavigationParams\(\)\.#' - '#Call to an undefined method OxidEsales\\Eshop\\Core\\Controller\\BaseController::getNavigationParams\(\)\.#'
- '#Call to an undefined method PHPUnit\\Framework\\MockObject\\MockObject::.*#' - '#Call to an undefined method PHPUnit\\Framework\\MockObject\\MockObject::.*#'
- '#Return type \(array\) of method D3\\Webauthn\\Application\\Controller\\d3webauthnlogin::getBreadCrumb\(\) should be compatible with return type \(null\) of method OxidEsales\\EshopCommunity\\Application\\Controller\\FrontendController::getBreadCrumb\(\)#' - '#Return type \(array\) of method D3\\Webauthn\\Application\\Controller\\d3webauthnlogin::getBreadCrumb\(\) should be compatible with return type \(null\) of method OxidEsales\\EshopCommunity\\Application\\Controller\\FrontendController::getBreadCrumb\(\)#'
- '#Method D3\\Webauthn\\Application\\Model\\RelyingPartyEntity::getActiveShop\(\) should return OxidEsales\\Eshop\\Application\\Model\\Shop but returns oxShop.#' - '#PHPDoc tag @throws with type OxidEsales\\EshopCommunity\\Internal\\Framework\\Module\\Configuration\\Exception\\ModuleConfigurationNotFoundException|Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'

Bestand weergeven

@ -169,7 +169,8 @@ class d3webauthnadminlogin extends AdminController
/** @var Request $request */ /** @var Request $request */
$request = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class); $request = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class);
return oxNew(WebauthnLogin::class, return oxNew(
WebauthnLogin::class,
$request->getRequestEscapedParameter('credential'), $request->getRequestEscapedParameter('credential'),
$request->getRequestEscapedParameter('error') $request->getRequestEscapedParameter('error')
); );

Bestand weergeven

@ -23,6 +23,7 @@ use DateTime;
use Doctrine\DBAL\Driver\Exception as DoctrineDriverException; use Doctrine\DBAL\Driver\Exception as DoctrineDriverException;
use Doctrine\DBAL\Exception as DoctrineException; use Doctrine\DBAL\Exception as DoctrineException;
use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Statement;
use Exception; use Exception;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Model\BaseModel; use OxidEsales\Eshop\Core\Model\BaseModel;
@ -205,7 +206,9 @@ class PublicKeyCredential extends BaseModel
) )
) )
); );
$oxid = $qb->execute()->fetchOne(); /** @var Statement $stmt */
$stmt = $qb->execute();
$oxid = $stmt->fetchOne();
return strlen((string) $oxid) ? $oxid : null; return strlen((string) $oxid) ? $oxid : null;
} }

Bestand weergeven

@ -20,6 +20,7 @@ use D3\TestingTools\Production\IsMockable;
use Doctrine\DBAL\Driver\Exception as DoctrineDriverException; use Doctrine\DBAL\Driver\Exception as DoctrineDriverException;
use Doctrine\DBAL\Exception as DoctrineException; use Doctrine\DBAL\Exception as DoctrineException;
use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Statement;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Model\ListModel; use OxidEsales\Eshop\Core\Model\ListModel;
@ -68,10 +69,10 @@ class PublicKeyCredentialList extends ListModel implements PublicKeyCredentialSo
) )
) )
); );
$credential = $qb->execute()->fetchOne(); /** @var Statement $stmt */
//dumpvar($qb->getSQL()); $stmt = $qb->execute();
//dumpvar($qb->getParameters()); $credential = $stmt->fetchOne();
//dumpvar(unserialize(base64_decode($credential)));
if (!strlen((string) $credential)) { if (!strlen((string) $credential)) {
return null; return null;
} }
@ -108,13 +109,16 @@ class PublicKeyCredentialList extends ListModel implements PublicKeyCredentialSo
) )
); );
/** @var Statement $stmt */
$stmt = $qb->execute();
// generate decoded credentials list // generate decoded credentials list
return array_map(function (array $fields) { return array_map(function (array $fields) {
/** @var PublicKeyCredential $credential */ /** @var PublicKeyCredential $credential */
$credential = clone $this->getBaseObject(); $credential = clone $this->getBaseObject();
$credential->assign(['credential' => $fields['credential']]); $credential->assign(['credential' => $fields['credential']]);
return $credential->getCredential(); return $credential->getCredential();
}, $qb->execute()->fetchAllAssociative()); }, $stmt->fetchAllAssociative());
} }
/** /**
@ -148,7 +152,9 @@ class PublicKeyCredentialList extends ListModel implements PublicKeyCredentialSo
) )
); );
foreach ($qb->execute()->fetchAllAssociative() as $fields) { /** @var Statement $stmt */
$stmt = $qb->execute();
foreach ($stmt->fetchAllAssociative() as $fields) {
$id = $fields['oxid']; $id = $fields['oxid'];
$credential = clone $this->getBaseObject(); $credential = clone $this->getBaseObject();
$credential->load($id); $credential->load($id);
@ -163,6 +169,8 @@ class PublicKeyCredentialList extends ListModel implements PublicKeyCredentialSo
* @param PublicKeyCredentialSource $publicKeyCredentialSource * @param PublicKeyCredentialSource $publicKeyCredentialSource
* @return void * @return void
* @throws AssertionFailedException * @throws AssertionFailedException
* @throws DoctrineDriverException
* @throws DoctrineException
*/ */
public function saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource): void public function saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource): void
{ {

Bestand weergeven

@ -80,6 +80,7 @@ class Webauthn
public function getCreationOptions(User $user): string public function getCreationOptions(User $user): string
{ {
d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user); d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user);
/** @var UserEntity $userEntity */
$userEntity = d3GetOxidDIC()->get(UserEntity::class); $userEntity = d3GetOxidDIC()->get(UserEntity::class);
$publicKeyCredentialCreationOptions = $this->getServer()->generatePublicKeyCredentialCreationOptions( $publicKeyCredentialCreationOptions = $this->getServer()->generatePublicKeyCredentialCreationOptions(
@ -140,6 +141,7 @@ class Webauthn
$user = d3GetOxidDIC()->get('d3ox.webauthn.'.User::class); $user = d3GetOxidDIC()->get('d3ox.webauthn.'.User::class);
$user->load($userId); $user->load($userId);
d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user); d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user);
/** @var UserEntity $userEntity */
$userEntity = d3GetOxidDIC()->get(UserEntity::class); $userEntity = d3GetOxidDIC()->get(UserEntity::class);
// We generate the set of options. // We generate the set of options.
@ -166,7 +168,9 @@ class Webauthn
protected function getServer(): Server protected function getServer(): Server
{ {
$server = $this->getServerObject(); $server = $this->getServerObject();
$server->setLogger(d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class)); /** @var LoggerInterface $logger */
$logger = d3GetOxidDIC()->get('d3ox.webauthn.'.LoggerInterface::class);
$server->setLogger($logger);
return $server; return $server;
} }
@ -248,7 +252,10 @@ class Webauthn
$user->load($userId); $user->load($userId);
d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user); d3GetOxidDIC()->set(UserEntity::class.'.args.user', $user);
return d3GetOxidDIC()->get(UserEntity::class); /** @var UserEntity $userEntity */
$userEntity = d3GetOxidDIC()->get(UserEntity::class);
return $userEntity;
} }
/** /**

Bestand weergeven

@ -32,7 +32,7 @@ class WebauthnErrors
public const UNSECURECONNECTION = 'D3_WEBAUTHN_ERR_UNSECURECONNECTION'; public const UNSECURECONNECTION = 'D3_WEBAUTHN_ERR_UNSECURECONNECTION';
/** /**
* @param $msg * @param string $msg
* @param null|string $type * @param null|string $type
* @return string * @return string
*/ */

Bestand weergeven

@ -117,7 +117,9 @@ class WebauthnLogin
$this->assertAuthn(); $this->assertAuthn();
// relogin, don't extract from this try block // relogin, don't extract from this try block
$usrCmp->setUser(d3GetOxidDIC()->get('d3ox.webauthn.'.User::class)); /** @var User $user */
$user = d3GetOxidDIC()->get('d3ox.webauthn.'.User::class);
$usrCmp->setUser($user);
$this->setFrontendSession($user); $this->setFrontendSession($user);
$usrCmp->setLoginStatus(USER_LOGIN_SUCCESS); $usrCmp->setLoginStatus(USER_LOGIN_SUCCESS);
@ -226,6 +228,7 @@ class WebauthnLogin
*/ */
public function setAdminSession($userId): Session public function setAdminSession($userId): Session
{ {
/** @var Session $session */
$session = d3GetOxidDIC()->get('d3ox.webauthn.'.Session::class); $session = d3GetOxidDIC()->get('d3ox.webauthn.'.Session::class);
$adminProfiles = $session->getVariable("aAdminProfiles"); $adminProfiles = $session->getVariable("aAdminProfiles");
$session->initNewSession(); $session->initNewSession();
@ -257,6 +260,7 @@ class WebauthnLogin
*/ */
public function assertUser($userId, bool $isBackend = false): User public function assertUser($userId, bool $isBackend = false): User
{ {
/** @var User $user */
$user = d3GetOxidDIC()->get('d3ox.webauthn.'.User::class); $user = d3GetOxidDIC()->get('d3ox.webauthn.'.User::class);
$user->load($userId); $user->load($userId);
if (!$user->isLoaded() || if (!$user->isLoaded() ||

Bestand weergeven

@ -167,7 +167,8 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
/** @var Request $request */ /** @var Request $request */
$request = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class); $request = d3GetOxidDIC()->get('d3ox.webauthn.'.Request::class);
return oxNew(WebauthnLogin::class, return oxNew(
WebauthnLogin::class,
$request->getRequestEscapedParameter('credential'), $request->getRequestEscapedParameter('credential'),
$request->getRequestEscapedParameter('error') $request->getRequestEscapedParameter('error')
); );

Bestand weergeven

@ -18,9 +18,11 @@ namespace D3\Webauthn\Modules\Application\Model;
use D3\TestingTools\Production\IsMockable; use D3\TestingTools\Production\IsMockable;
use D3\Webauthn\Application\Model\WebauthnConf; use D3\Webauthn\Application\Model\WebauthnConf;
use Doctrine\DBAL\Driver\Exception as DoctrineDriverException; use Doctrine\DBAL\Driver\Exception as DoctrineDriverException;
use Doctrine\DBAL\Driver\Mysqli\MysqliStatement;
use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Query\QueryBuilder; use Doctrine\DBAL\Query\QueryBuilder;
use OxidEsales\Eshop\Application\Model\User; use Doctrine\DBAL\Statement;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
@ -144,6 +146,8 @@ class d3_User_Webauthn extends d3_User_Webauthn_parent
) )
)->setMaxResults(1); )->setMaxResults(1);
return $qb->execute()->fetchOne() ?: null; /** @var Statement $stmt */
$stmt = $qb->execute();
return $stmt->fetchOne() ?: null;
} }
} }

Bestand weergeven

@ -21,7 +21,6 @@ use Exception;
use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Application\Controller\FrontendController;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface; use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\DbMetaDataHandler; use OxidEsales\Eshop\Core\DbMetaDataHandler;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException; use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException; use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
@ -39,11 +38,10 @@ use Psr\Log\LoggerInterface;
class Actions class Actions
{ {
use IsMockable;
public const FIELDLENGTH_CREDID = 512; public const FIELDLENGTH_CREDID = 512;
public const FIELDLENGTH_CREDENTIAL = 2000; public const FIELDLENGTH_CREDENTIAL = 2000;
use IsMockable;
public $seo_de = 'sicherheitsschluessel'; public $seo_de = 'sicherheitsschluessel';
public $seo_en = 'en/key-authentication'; public $seo_en = 'en/key-authentication';
public $stdClassName = 'd3_account_webauthn'; public $stdClassName = 'd3_account_webauthn';

Bestand weergeven

@ -14,7 +14,6 @@
namespace D3\Webauthn\tests; namespace D3\Webauthn\tests;
use D3\ModCfg\Tests\additional_abstract; use D3\ModCfg\Tests\additional_abstract;
use OxidEsales\Eshop\Core\Exception\StandardException;
class additional extends additional_abstract class additional extends additional_abstract
{ {

Bestand weergeven

@ -18,7 +18,6 @@ namespace D3\Webauthn\tests\integration;
use D3\Webauthn\Application\Model\WebauthnConf; use D3\Webauthn\Application\Model\WebauthnConf;
use OxidEsales\Eshop\Application\Controller\Admin\LoginController; use OxidEsales\Eshop\Application\Controller\Admin\LoginController;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface; use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
class passwordAdminAuthTest extends integrationTestCase class passwordAdminAuthTest extends integrationTestCase

Bestand weergeven

@ -28,7 +28,6 @@ use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Utils; use OxidEsales\Eshop\Core\Utils;
use OxidEsales\Eshop\Core\UtilsView; use OxidEsales\Eshop\Core\UtilsView;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use ReflectionException; use ReflectionException;
@ -73,7 +72,7 @@ class d3user_webauthnTest extends WAUnitTestCase
$sutMock = $this->getMockBuilder(d3user_webauthn::class) $sutMock = $this->getMockBuilder(d3user_webauthn::class)
->onlyMethods([ ->onlyMethods([
'd3CallMockableFunction', 'd3CallMockableFunction',
'getEditObjectId' 'getEditObjectId',
]) ])
->getMock(); ->getMock();
$sutMock->method('d3CallMockableFunction')->willReturn(true); $sutMock->method('d3CallMockableFunction')->willReturn(true);
@ -132,7 +131,7 @@ class d3user_webauthnTest extends WAUnitTestCase
$sutMock = $this->getMockBuilder(d3user_webauthn::class) $sutMock = $this->getMockBuilder(d3user_webauthn::class)
->onlyMethods([ ->onlyMethods([
'setPageType', 'setPageType',
'setAuthnRegister' 'setAuthnRegister',
]) ])
->getMock(); ->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType'); $sutMock->expects($this->atLeastOnce())->method('setPageType');
@ -169,7 +168,7 @@ class d3user_webauthnTest extends WAUnitTestCase
$sutMock = $this->getMockBuilder(d3user_webauthn::class) $sutMock = $this->getMockBuilder(d3user_webauthn::class)
->onlyMethods([ ->onlyMethods([
'setPageType', 'setPageType',
'setAuthnRegister' 'setAuthnRegister',
]) ])
->getMock(); ->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType'); $sutMock->expects($this->atLeastOnce())->method('setPageType');

Bestand weergeven

@ -25,7 +25,6 @@ use D3\Webauthn\Application\Model\WebauthnConf;
use D3\Webauthn\Application\Model\WebauthnLogin; use D3\Webauthn\Application\Model\WebauthnLogin;
use D3\Webauthn\tests\unit\Application\Controller\d3webauthnloginTest; use D3\Webauthn\tests\unit\Application\Controller\d3webauthnloginTest;
use Generator; use Generator;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Request;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\Eshop\Core\Utils; use OxidEsales\Eshop\Core\Utils;

Bestand weergeven

@ -25,10 +25,8 @@ use D3\Webauthn\Application\Model\Webauthn;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use Generator; use Generator;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Request;
use OxidEsales\Eshop\Core\UtilsView; use OxidEsales\Eshop\Core\UtilsView;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -22,10 +22,8 @@ use D3\Webauthn\Application\Model\Webauthn;
use D3\Webauthn\Application\Model\WebauthnConf; use D3\Webauthn\Application\Model\WebauthnConf;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use Generator; use Generator;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\Eshop\Core\Utils; use OxidEsales\Eshop\Core\Utils;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -20,11 +20,8 @@ use D3\Webauthn\Application\Model\Credential\PublicKeyCredential;
use D3\Webauthn\Application\Model\Credential\PublicKeyCredentialList; use D3\Webauthn\Application\Model\Credential\PublicKeyCredentialList;
use D3\Webauthn\Application\Model\UserEntity; use D3\Webauthn\Application\Model\UserEntity;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use Hoa\Iterator\Mock;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;
use Webauthn\PublicKeyCredentialSource; use Webauthn\PublicKeyCredentialSource;
@ -95,7 +92,7 @@ class PublicKeyCredentialListTest extends WAUnitTestCase
'oxshopid' => 55, 'oxshopid' => 55,
'name' => __METHOD__, 'name' => __METHOD__,
// can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable // can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable
'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9' 'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9',
]); ]);
$pkc->save(); $pkc->save();
} }
@ -174,7 +171,7 @@ class PublicKeyCredentialListTest extends WAUnitTestCase
'oxshopid' => 55, 'oxshopid' => 55,
'credentialid' => __METHOD__, 'credentialid' => __METHOD__,
// can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable // can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable
'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9' 'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9',
]); ]);
$pkc->save(); $pkc->save();
} }
@ -195,9 +192,9 @@ class PublicKeyCredentialListTest extends WAUnitTestCase
); );
if ($expected === 'pkcsource') { if ($expected === 'pkcsource') {
$this->assertCount( 2, $list ); $this->assertCount(2, $list);
foreach ( $list as $item ) { foreach ($list as $item) {
$this->assertInstanceOf( PublicKeyCredentialSource::class, $item ); $this->assertInstanceOf(PublicKeyCredentialSource::class, $item);
} }
} else { } else {
$this->assertEmpty($list); $this->assertEmpty($list);
@ -205,7 +202,7 @@ class PublicKeyCredentialListTest extends WAUnitTestCase
} finally { } finally {
if ($doCreate) { if ($doCreate) {
foreach ($oxids as $oxid) { foreach ($oxids as $oxid) {
/** @var PublicKeyCredential $pkc */ /** @var PublicKeyCredential|MockObject $pkc */
$pkc = $this->getMockBuilder(PublicKeyCredential::class) $pkc = $this->getMockBuilder(PublicKeyCredential::class)
->onlyMethods(['allowDerivedDelete']) ->onlyMethods(['allowDerivedDelete'])
->getMock(); ->getMock();
@ -262,7 +259,7 @@ class PublicKeyCredentialListTest extends WAUnitTestCase
'oxshopid' => 55, 'oxshopid' => 55,
'credentialid' => __METHOD__, 'credentialid' => __METHOD__,
// can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable // can't get mock of PublicKeyCredentialSource because of cascaded mock object is not serializable
'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9' 'credential' => 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo2NToiAQUtRW3vxImpllhVhp3sUeC0aBae8rFm0hBhHpVSdkdrmqZp+tnfgcuP8xJUbsjMMDyt908zZ2RXAtibmbbilOciO3M6NzoiACoAdHlwZSI7czoxMDoicHVibGljLWtleSI7czoxMzoiACoAdHJhbnNwb3J0cyI7YTowOnt9czoxODoiACoAYXR0ZXN0YXRpb25UeXBlIjtzOjQ6Im5vbmUiO3M6MTI6IgAqAHRydXN0UGF0aCI7TzozMzoiV2ViYXV0aG5cVHJ1c3RQYXRoXEVtcHR5VHJ1c3RQYXRoIjowOnt9czo5OiIAKgBhYWd1aWQiO086MzU6IlJhbXNleVxVdWlkXExhenlcTGF6eVV1aWRGcm9tU3RyaW5nIjoxOntzOjY6InN0cmluZyI7czozNjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIjt9czoyMjoiACoAY3JlZGVudGlhbFB1YmxpY0tleSI7czo3NzoipQECAyYgASFYIKelzI2/b094o/XiJmXWUkVr8cvhAucLplHTxtl0oKtrIlgguKi+0epmmjeemuzzGspNotA7uKnkk4oAmDUOKsJgLykiO3M6MTM6IgAqAHVzZXJIYW5kbGUiO3M6MTQ6Im94ZGVmYXVsdGFkbWluIjtzOjEwOiIAKgBjb3VudGVyIjtpOjA7czoxMDoiACoAb3RoZXJVSSI7Tjt9',
]); ]);
$pkc->save(); $pkc->save();
} }

Bestand weergeven

@ -20,8 +20,6 @@ use D3\Webauthn\Application\Model\Credential\PublicKeyCredential;
use D3\Webauthn\Application\Model\Credential\PublicKeyCredentialList; use D3\Webauthn\Application\Model\Credential\PublicKeyCredentialList;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;
use Webauthn\PublicKeyCredentialSource; use Webauthn\PublicKeyCredentialSource;

Bestand weergeven

@ -18,7 +18,6 @@ namespace D3\Webauthn\tests\unit\Application\Model\Exceptions;
use D3\TestingTools\Development\CanAccessRestricted; use D3\TestingTools\Development\CanAccessRestricted;
use D3\Webauthn\Application\Model\Exceptions\WebauthnCreateException; use D3\Webauthn\Application\Model\Exceptions\WebauthnCreateException;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -20,7 +20,6 @@ use D3\Webauthn\Application\Model\Exceptions\WebauthnException;
use D3\Webauthn\Application\Model\WebauthnErrors; use D3\Webauthn\Application\Model\WebauthnErrors;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use Exception; use Exception;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -18,7 +18,6 @@ namespace D3\Webauthn\tests\unit\Application\Model\Exceptions;
use D3\TestingTools\Development\CanAccessRestricted; use D3\TestingTools\Development\CanAccessRestricted;
use D3\Webauthn\Application\Model\Exceptions\WebauthnGetException; use D3\Webauthn\Application\Model\Exceptions\WebauthnGetException;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -20,7 +20,6 @@ use D3\Webauthn\Application\Model\RelyingPartyEntity;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Application\Model\Shop; use OxidEsales\Eshop\Application\Model\Shop;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use ReflectionException; use ReflectionException;
class RelyingPartyEntityTest extends WAUnitTestCase class RelyingPartyEntityTest extends WAUnitTestCase

Bestand weergeven

@ -20,7 +20,6 @@ use D3\Webauthn\Application\Model\Exceptions\WebauthnException;
use D3\Webauthn\Application\Model\UserEntity; use D3\Webauthn\Application\Model\UserEntity;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -20,11 +20,9 @@ use D3\Webauthn\Application\Model\WebauthnAfterLogin;
use D3\Webauthn\Application\Model\WebauthnConf; use D3\Webauthn\Application\Model\WebauthnConf;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Core\Language; use OxidEsales\Eshop\Core\Language;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Request;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\Eshop\Core\UtilsServer; use OxidEsales\Eshop\Core\UtilsServer;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;
use stdClass; use stdClass;

Bestand weergeven

@ -19,8 +19,6 @@ use D3\TestingTools\Development\CanAccessRestricted;
use D3\Webauthn\Application\Model\WebauthnErrors; use D3\Webauthn\Application\Model\WebauthnErrors;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Core\Language; use OxidEsales\Eshop\Core\Language;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -35,7 +35,6 @@ use OxidEsales\Eshop\Core\SystemEventHandler;
use OxidEsales\Eshop\Core\Utils; use OxidEsales\Eshop\Core\Utils;
use OxidEsales\Eshop\Core\UtilsServer; use OxidEsales\Eshop\Core\UtilsServer;
use OxidEsales\Eshop\Core\UtilsView; use OxidEsales\Eshop\Core\UtilsView;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use ReflectionException; use ReflectionException;
@ -325,7 +324,7 @@ class WebauthnLoginTest extends WAUnitTestCase
/** @var WebauthnLogin|MockObject $sut */ /** @var WebauthnLogin|MockObject $sut */
$sut = $this->getMockBuilder(WebauthnLogin::class) $sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', ->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights']) 'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -378,7 +377,7 @@ class WebauthnLoginTest extends WAUnitTestCase
/** @var WebauthnLogin|MockObject $sut */ /** @var WebauthnLogin|MockObject $sut */
$sut = $this->getMockBuilder(WebauthnLogin::class) $sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', ->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights']) 'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass)); $sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass));

Bestand weergeven

@ -29,10 +29,8 @@ use Exception;
use Generator; use Generator;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\Eshop\Core\UtilsView; use OxidEsales\Eshop\Core\UtilsView;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;
use stdClass; use stdClass;

Bestand weergeven

@ -16,6 +16,7 @@ declare(strict_types=1);
namespace D3\Webauthn\tests\unit\Modules\Application\Component; namespace D3\Webauthn\tests\unit\Modules\Application\Component;
use D3\TestingTools\Development\CanAccessRestricted; use D3\TestingTools\Development\CanAccessRestricted;
use D3\Webauthn\Application\Controller\Admin\d3webauthnadminlogin;
use D3\Webauthn\Application\Model\Exceptions\WebauthnGetException; use D3\Webauthn\Application\Model\Exceptions\WebauthnGetException;
use D3\Webauthn\Application\Model\Exceptions\WebauthnLoginErrorException; use D3\Webauthn\Application\Model\Exceptions\WebauthnLoginErrorException;
use D3\Webauthn\Application\Model\Webauthn; use D3\Webauthn\Application\Model\Webauthn;
@ -27,12 +28,10 @@ use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Application\Component\UserComponent; use OxidEsales\Eshop\Application\Component\UserComponent;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Controller\BaseController; use OxidEsales\Eshop\Core\Controller\BaseController;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Request;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\Eshop\Core\Utils; use OxidEsales\Eshop\Core\Utils;
use OxidEsales\Eshop\Core\UtilsView; use OxidEsales\Eshop\Core\UtilsView;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -21,10 +21,8 @@ use D3\Webauthn\Application\Model\WebauthnConf;
use D3\Webauthn\tests\unit\WAUnitTestCase; use D3\Webauthn\tests\unit\WAUnitTestCase;
use OxidEsales\Eshop\Application\Controller\Admin\LoginController; use OxidEsales\Eshop\Application\Controller\Admin\LoginController;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; use OxidEsales\Eshop\Core\Request;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -22,7 +22,6 @@ use OxidEsales\Eshop\Application\Controller\OrderController;
use OxidEsales\Eshop\Application\Controller\PaymentController; use OxidEsales\Eshop\Application\Controller\PaymentController;
use OxidEsales\Eshop\Application\Controller\UserController; use OxidEsales\Eshop\Application\Controller\UserController;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;

Bestand weergeven

@ -24,9 +24,7 @@ use Exception;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Exception\UserException; use OxidEsales\Eshop\Core\Exception\UserException;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Session; use OxidEsales\Eshop\Core\Session;
use OxidEsales\TestingLibrary\UnitTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use ReflectionException; use ReflectionException;