improve code

This commit is contained in:
Daniel Seifert 2022-12-13 22:24:33 +01:00
parent 4183ebcf99
commit 68b9f53c14
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
81 changed files with 271 additions and 218 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea .idea
.php_cs.cache
src/tests/.phpunit.result.cache src/tests/.phpunit.result.cache
src/tests/reports/ src/tests/reports/

13
.php-cs-fixer.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP74Migration' => true,
'@PSR12' => true
])
->setFinder($finder)
;

View File

@ -39,6 +39,7 @@
"ext-json": "*" "ext-json": "*"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.19",
"phpstan/phpstan": "^1.8" "phpstan/phpstan": "^1.8"
}, },
"autoload": { "autoload": {

View File

@ -118,7 +118,8 @@ class d3webauthnadminlogin extends AdminController
public function d3AssertAuthn(): ?string public function d3AssertAuthn(): ?string
{ {
try { try {
$login = $this->d3GetMockableOxNewObject(WebauthnLogin::class, $login = $this->d3GetMockableOxNewObject(
WebauthnLogin::class,
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'), $this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'),
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error') $this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error')
); );

View File

@ -49,7 +49,7 @@ class PublicKeyCredential extends BaseModel
public function setName(string $name): void public function setName(string $name): void
{ {
$this->assign([ $this->assign([
'name' => $name 'name' => $name,
]); ]);
} }
@ -67,7 +67,7 @@ class PublicKeyCredential extends BaseModel
public function setCredentialId(string $credentialId): void public function setCredentialId(string $credentialId): void
{ {
$this->assign([ $this->assign([
'credentialid' => base64_encode($credentialId) 'credentialid' => base64_encode($credentialId),
]); ]);
} }
@ -85,7 +85,7 @@ class PublicKeyCredential extends BaseModel
public function setUserId(string $userId): void public function setUserId(string $userId): void
{ {
$this->assign([ $this->assign([
'oxuserid' => $userId 'oxuserid' => $userId,
]); ]);
} }
@ -103,7 +103,7 @@ class PublicKeyCredential extends BaseModel
public function setCredential(PublicKeyCredentialSource $credential): void public function setCredential(PublicKeyCredentialSource $credential): void
{ {
$this->assign([ $this->assign([
'credential' => base64_encode(serialize($credential)) 'credential' => base64_encode(serialize($credential)),
]); ]);
} }

View File

@ -33,12 +33,12 @@ class WebauthnException extends StandardException
$this->d3CallMockableFunction( $this->d3CallMockableFunction(
[ [
StandardException::class, StandardException::class,
'__construct' '__construct',
], ],
[ [
$this->getErrorMessageTranslator()->translateError($sMessage, $this->getRequestType()), $this->getErrorMessageTranslator()->translateError($sMessage, $this->getRequestType()),
$iCode, $iCode,
$previous $previous,
] ]
); );
} }

View File

@ -29,11 +29,11 @@ class RelyingPartyEntity extends PublicKeyCredentialRpEntity
$this->d3CallMockableFunction( $this->d3CallMockableFunction(
[ [
PublicKeyCredentialRpEntity::class, PublicKeyCredentialRpEntity::class,
'__construct' '__construct',
], ],
[ [
$this->getActiveShop()->getFieldData('oxname'), $this->getActiveShop()->getFieldData('oxname'),
$this->getRPShopUrl() $this->getRPShopUrl(),
] ]
); );
} }

View File

@ -39,12 +39,12 @@ class UserEntity extends PublicKeyCredentialUserEntity
$this->d3CallMockableFunction( $this->d3CallMockableFunction(
[ [
PublicKeyCredentialUserEntity::class, PublicKeyCredentialUserEntity::class,
'__construct' '__construct',
], ],
[ [
strtolower($user->getFieldData('oxusername')), strtolower($user->getFieldData('oxusername')),
$user->getId(), $user->getId(),
$user->getFieldData('oxfname') . ' ' . $user->getFieldData('oxlname') $user->getFieldData('oxfname') . ' ' . $user->getFieldData('oxlname'),
] ]
); );
} }

View File

@ -16,7 +16,7 @@ $sLangName = 'Deutsch';
// ------------------------------- // -------------------------------
// RESOURCE IDENTIFIER = STRING // RESOURCE IDENTIFIER = STRING
// ------------------------------- // -------------------------------
$aLang = array( $aLang = [
'charset' => 'UTF-8', 'charset' => 'UTF-8',
'PAGE_TITLE_D3WEBAUTHNLOGIN' => 'Passwortloses Anmelden', 'PAGE_TITLE_D3WEBAUTHNLOGIN' => 'Passwortloses Anmelden',
@ -47,4 +47,4 @@ $aLang = array(
'D3_WEBAUTHN_ERR_UNSECURECONNECTION' => 'Die Verwendung von Sicherheitsschlüsseln ist nur bei lokalen oder gesicherten Verbindungen (https) möglich.', 'D3_WEBAUTHN_ERR_UNSECURECONNECTION' => 'Die Verwendung von Sicherheitsschlüsseln ist nur bei lokalen oder gesicherten Verbindungen (https) möglich.',
'D3_WEBAUTHN_ERR_LOGINPROHIBITED' => 'Die Anmeldung mit Sicherheitsschlüssel ist aus technischen Gründen derzeit leider nicht möglich. Bitte verwenden Sie statt dessen Ihr Passwort.', 'D3_WEBAUTHN_ERR_LOGINPROHIBITED' => 'Die Anmeldung mit Sicherheitsschlüssel ist aus technischen Gründen derzeit leider nicht möglich. Bitte verwenden Sie statt dessen Ihr Passwort.',
'D3_WEBAUTHN_ERR_NOTLOADEDUSER' => "Kann keine Anmeldedaten von nicht geladenem Kundenkonto beziehen.", 'D3_WEBAUTHN_ERR_NOTLOADEDUSER' => "Kann keine Anmeldedaten von nicht geladenem Kundenkonto beziehen.",
); ];

View File

@ -56,5 +56,5 @@ $aLang = [
'<p>Ist Ihr Shop unter verschiedenen Subdomains erreichbar, können Sie hier die Hauptdomain angeben, die zur Registrierung verwendet werden soll. Beachten Sie bitte, '. '<p>Ist Ihr Shop unter verschiedenen Subdomains erreichbar, können Sie hier die Hauptdomain angeben, die zur Registrierung verwendet werden soll. Beachten Sie bitte, '.
'dass die hier angegebene Adresse mit der des Shopaufrufs übereinstimmen muss. Shopfremde Adressen werden bei der Verwendung abgelehnt.</p>'. 'dass die hier angegebene Adresse mit der des Shopaufrufs übereinstimmen muss. Shopfremde Adressen werden bei der Verwendung abgelehnt.</p>'.
'<p>Bleibt das Feld leer, wird die Adresse des aktuellen Shopaufrufs verwendet. Bei Verwendung unterschiedlicher Adressen muss vom Nutzer für jede Adresse eine separate '. '<p>Bleibt das Feld leer, wird die Adresse des aktuellen Shopaufrufs verwendet. Bei Verwendung unterschiedlicher Adressen muss vom Nutzer für jede Adresse eine separate '.
'Schlüsselregistrierung durchgeführt werden.</p>' 'Schlüsselregistrierung durchgeführt werden.</p>',
]; ];

View File

@ -57,5 +57,5 @@ $aLang = [
'<p>If your shop can be reached under different subdomains, you can enter the main domain here that is to be used for registration. Please '. '<p>If your shop can be reached under different subdomains, you can enter the main domain here that is to be used for registration. Please '.
'note that the address given here must match the address of the shop call. Addresses that do not match the shop will be rejected.</p>'. 'note that the address given here must match the address of the shop call. Addresses that do not match the shop will be rejected.</p>'.
'<p>If the field remains empty, the address of the current shop call is used. If different addresses are used, a separate key registration '. '<p>If the field remains empty, the address of the current shop call is used. If different addresses are used, a separate key registration '.
'must be carried out by the user for each address.</p>' 'must be carried out by the user for each address.</p>',
]; ];

View File

@ -15,7 +15,9 @@ namespace D3\Webauthn\Modules\Application\Component
{ {
use OxidEsales\Eshop\Application\Component\UserComponent; use OxidEsales\Eshop\Application\Component\UserComponent;
class d3_webauthn_UserComponent_parent extends UserComponent {} class d3_webauthn_UserComponent_parent extends UserComponent
{
}
} }
namespace D3\Webauthn\Modules\Application\Controller namespace D3\Webauthn\Modules\Application\Controller
@ -35,44 +37,74 @@ namespace D3\Webauthn\Modules\Application\Controller
use OxidEsales\Eshop\Application\Controller\PaymentController; use OxidEsales\Eshop\Application\Controller\PaymentController;
use OxidEsales\Eshop\Application\Controller\UserController; use OxidEsales\Eshop\Application\Controller\UserController;
class d3_webauthn_UserController_parent extends UserController {} class d3_webauthn_UserController_parent extends UserController
{
}
class d3_webauthn_OrderController_parent extends OrderController {} class d3_webauthn_OrderController_parent extends OrderController
{
}
class d3_webauthn_PaymentController_parent extends PaymentController {} class d3_webauthn_PaymentController_parent extends PaymentController
{
}
/** workarounds for missing tpl blocks (https://github.com/OXID-eSales/wave-theme/pull/124) */ /** workarounds for missing tpl blocks (https://github.com/OXID-eSales/wave-theme/pull/124) */
class d3_AccountController_Webauthn_parent extends AccountController {} class d3_AccountController_Webauthn_parent extends AccountController
{
}
class d3_AccountDownloadsController_Webauthn_parent extends AccountDownloadsController {} class d3_AccountDownloadsController_Webauthn_parent extends AccountDownloadsController
{
}
class d3_AccountNoticeListController_Webauthn_parent extends AccountNoticeListController {} class d3_AccountNoticeListController_Webauthn_parent extends AccountNoticeListController
{
}
class d3_AccountWishlistController_Webauthn_parent extends AccountWishlistController {} class d3_AccountWishlistController_Webauthn_parent extends AccountWishlistController
{
}
class d3_AccountRecommlistController_Webauthn_parent extends AccountRecommlistController {} class d3_AccountRecommlistController_Webauthn_parent extends AccountRecommlistController
{
}
class d3_AccountPasswordController_Webauthn_parent extends AccountPasswordController {} class d3_AccountPasswordController_Webauthn_parent extends AccountPasswordController
{
}
class d3_AccountNewsletterController_Webauthn_parent extends AccountNewsletterController {} class d3_AccountNewsletterController_Webauthn_parent extends AccountNewsletterController
{
}
class d3_AccountUserController_Webauthn_parent extends AccountUserController {} class d3_AccountUserController_Webauthn_parent extends AccountUserController
{
}
class d3_AccountOrderController_Webauthn_parent extends AccountOrderController {} class d3_AccountOrderController_Webauthn_parent extends AccountOrderController
{
}
class d3_AccountReviewController_Webauthn_parent extends AccountReviewController {} class d3_AccountReviewController_Webauthn_parent extends AccountReviewController
{
}
} }
namespace D3\Webauthn\Modules\Application\Controller\Admin namespace D3\Webauthn\Modules\Application\Controller\Admin
{ {
use OxidEsales\Eshop\Application\Controller\Admin\LoginController; use OxidEsales\Eshop\Application\Controller\Admin\LoginController;
class d3_LoginController_Webauthn_parent extends LoginController {} class d3_LoginController_Webauthn_parent extends LoginController
{
}
} }
namespace D3\Webauthn\Modules\Application\Model namespace D3\Webauthn\Modules\Application\Model
{ {
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
class d3_User_Webauthn_parent extends User {} class d3_User_Webauthn_parent extends User
{
}
} }

View File

@ -147,7 +147,8 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
public function d3AssertAuthn(): void public function d3AssertAuthn(): void
{ {
try { try {
$login = $this->d3GetMockableOxNewObject(WebauthnLogin::class, $login = $this->d3GetMockableOxNewObject(
WebauthnLogin::class,
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'), $this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('credential'),
$this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error') $this->d3GetMockableRegistryObject(Request::class)->getRequestEscapedParameter('error')
); );
@ -158,6 +159,7 @@ class d3_webauthn_UserComponent extends d3_webauthn_UserComponent_parent
$this->_afterLogin($this->getUser()); $this->_afterLogin($this->getUser());
} catch (WebauthnGetException $e) { } catch (WebauthnGetException $e) {
$this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay($e); $this->d3GetMockableRegistryObject(UtilsView::class)->addErrorToDisplay($e);
} catch (WebauthnLoginErrorException $e) {} } catch (WebauthnLoginErrorException $e) {
}
} }
} }

View File

@ -99,7 +99,7 @@ class d3_User_Webauthn extends d3_User_Webauthn_parent
$this, $this,
[ [
$userName, $userName,
$shopId $shopId,
] ]
); );
} }

View File

@ -61,7 +61,7 @@ $logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="he
/** /**
* Module information * Module information
*/ */
$aModule = array( $aModule = [
'id' => $sModuleId, 'id' => $sModuleId,
'title' => $logo.' Webauthn / FIDO2 Login', 'title' => $logo.' Webauthn / FIDO2 Login',
'description' => [ 'description' => [
@ -90,13 +90,13 @@ $aModule = array(
AccountNewsletterController::class => d3_AccountNewsletterController_Webauthn::class, AccountNewsletterController::class => d3_AccountNewsletterController_Webauthn::class,
AccountUserController::class => d3_AccountUserController_Webauthn::class, AccountUserController::class => d3_AccountUserController_Webauthn::class,
AccountOrderController::class => d3_AccountOrderController_Webauthn::class, AccountOrderController::class => d3_AccountOrderController_Webauthn::class,
AccountReviewController::class => d3_AccountReviewController_Webauthn::class AccountReviewController::class => d3_AccountReviewController_Webauthn::class,
], ],
'controllers' => [ 'controllers' => [
'd3user_webauthn' => d3user_webauthn::class, 'd3user_webauthn' => d3user_webauthn::class,
'd3webauthnlogin' => d3webauthnlogin::class, 'd3webauthnlogin' => d3webauthnlogin::class,
'd3webauthnadminlogin' => d3webauthnadminlogin::class, 'd3webauthnadminlogin' => d3webauthnadminlogin::class,
'd3_account_webauthn' => d3_account_webauthn::class 'd3_account_webauthn' => d3_account_webauthn::class,
], ],
'templates' => [ 'templates' => [
'd3user_webauthn.tpl' => 'd3/oxwebauthn/Application/views/admin/tpl/d3user_webauthn.tpl', 'd3user_webauthn.tpl' => 'd3/oxwebauthn/Application/views/admin/tpl/d3user_webauthn.tpl',
@ -139,14 +139,14 @@ $aModule = array(
'template' => 'page/checkout/inc/options.tpl', 'template' => 'page/checkout/inc/options.tpl',
'block' => 'checkout_options_login', 'block' => 'checkout_options_login',
'file' => 'Application/views/blocks/page/checkout/inc/checkout_options_login.tpl', 'file' => 'Application/views/blocks/page/checkout/inc/checkout_options_login.tpl',
] ],
], ],
'settings' => [ 'settings' => [
[ [
'group' => $sModuleId.'_general', 'group' => $sModuleId.'_general',
'name' => $sModuleId.'_diffshopurl', 'name' => $sModuleId.'_diffshopurl',
'type' => 'str', 'type' => 'str',
'value' => false 'value' => false,
], ],
] ],
); ];

View File

@ -41,7 +41,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'noadmin@user.localhost', 'oxusername' => 'noadmin@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456 'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
], ],
true true
); );
@ -54,7 +54,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'admin@user.localhost', 'oxusername' => 'admin@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456 'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
], ],
true true
); );
@ -67,7 +67,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 2, 'oxshopid' => 2,
'oxusername' => 'wrongshop@user.localhost', 'oxusername' => 'wrongshop@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456 'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
], ],
true true
); );
@ -80,7 +80,7 @@ class passwordAdminAuthTest extends integrationTestCase
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'inactive@user.localhost', 'oxusername' => 'inactive@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456 'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
], ],
true true
); );

View File

@ -36,7 +36,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'noadmin@user.localhost', 'oxusername' => 'noadmin@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456 'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
] ]
); );
@ -48,7 +48,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 2, 'oxshopid' => 2,
'oxusername' => 'wrongshop_fe@user.localhost', 'oxusername' => 'wrongshop_fe@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456 'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
] ]
); );
@ -60,7 +60,7 @@ class passwordFrontendAuthTest extends integrationTestCase
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'inactive@user.localhost', 'oxusername' => 'inactive@user.localhost',
'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456 'oxpassword' => '$2y$10$b3O5amXZVMGGZbL4X10TIOHiOwEkq3C0ofObuTgHAS4Io0uMLauUS', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
] ]
); );
} }

View File

@ -32,7 +32,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
2 => 'credId2', 2 => 'credId2',
3 => 'credId3', 3 => 'credId3',
4 => 'credId4', 4 => 'credId4',
5 => 'credId5' 5 => 'credId5',
]; ];
public function createTestData() public function createTestData()
@ -47,7 +47,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1, 'oxshopid' => 1,
'oxusername' => 'wawrongshopid@user.localhost', 'oxusername' => 'wawrongshopid@user.localhost',
'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456 'oxpassword' => '$2y$10$QErMJNHQCoN03tfCUQDRfOvbwvqfzwWw1iI/7bC49fKQrPKoDdnaK', // 123456
'oxstreet' => __CLASS__ 'oxstreet' => __CLASS__,
], ],
true true
); );
@ -60,7 +60,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1, 'oxshopid' => 1,
'name' => __CLASS__, 'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==', 'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibG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3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
] ]
); );
@ -72,7 +72,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1, 'oxshopid' => 1,
'name' => __CLASS__, 'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==', 'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==',
'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909t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RtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=' 'credential'=> 'TzozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
] ]
); );
@ -96,7 +96,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 1, 'oxshopid' => 1,
'name' => __CLASS__, 'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDC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zozNDoiV2ViYXV0aG5cUHVibGljS2V5Q3JlZGVudGlhbFNvdXJjZSI6MTA6e3M6MjQ6IgAqAHB1YmxpY0tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
] ]
); );
@ -108,7 +108,7 @@ class webauthnAdminAuthTest extends passwordAdminAuthTest
'oxshopid' => 2, 'oxshopid' => 2,
'name' => __CLASS__, 'name' => __CLASS__,
'credentialid' => 'ITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAAA==', 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tleUNyZWRlbnRpYWxJZCI7czo3MDoiITSNkDRdN1bfRrb9MDCNOfBNay7YqT3ZxWxxqIQWVvwN0tFOG7SN2JiCfcUfPMBhE9bTLU1Gbb/8+5eHyFR2d5DCrxAAACI7czo3OiIAKgB0eXBlIjtzOjEwOiJwdWJsaWMta2V5IjtzOjEzOiIAKgB0cmFuc3BvcnRzIjthOjA6e31zOjE4OiIAKgBhdHRlc3RhdGlvblR5cGUiO3M6NDoibm9uZSI7czoxMjoiACoAdHJ1c3RQYXRoIjtPOjMzOiJXZWJhdXRoblxUcnVzdFBhdGhcRW1wdHlUcnVzdFBhdGgiOjA6e31zOjk6IgAqAGFhZ3VpZCI7TzozNToiUmFtc2V5XFV1aWRcTGF6eVxMYXp5VXVpZEZyb21TdHJpbmciOjE6e3M6Njoic3RyaW5nIjtzOjM2OiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiO31zOjIyOiIAKgBjcmVkZW50aWFsUHVibGljS2V5IjtzOjc3OiKlAQIDJiABIVggHucXfQh0acwpsffVRM02F7P57mVm6hPX/l8Pjbh0jOwiWCBRT5MMqa909tcXHqG/EKfjXXDd9UEisk+ZF7QSTfwv0CI7czoxMzoiACoAdXNlckhhbmRsZSI7czoxNDoib3hkZWZhdWx0YWRtaW4iO3M6MTA6IgAqAGNvdW50ZXIiO2k6NDI3MTtzOjEwOiIAKgBvdGhlclVJIjtOO30=',
] ]
); );
} }

View File

@ -71,7 +71,7 @@ class d3user_webauthnTest extends TestCase
->onlyMethods([ ->onlyMethods([
'd3CallMockableFunction', 'd3CallMockableFunction',
'getEditObjectId', 'getEditObjectId',
'd3GetMockableOxNewObject' 'd3GetMockableOxNewObject',
]) ])
->getMock(); ->getMock();
$sutMock->method('d3CallMockableFunction')->willReturn(true); $sutMock->method('d3CallMockableFunction')->willReturn(true);
@ -145,7 +145,7 @@ class d3user_webauthnTest extends TestCase
'setPageType', 'setPageType',
'setAuthnRegister', 'setAuthnRegister',
'd3GetMockableLogger', 'd3GetMockableLogger',
'd3GetMockableRegistryObject' 'd3GetMockableRegistryObject',
]) ])
->getMock(); ->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType'); $sutMock->expects($this->atLeastOnce())->method('setPageType');
@ -194,7 +194,7 @@ class d3user_webauthnTest extends TestCase
'setPageType', 'setPageType',
'setAuthnRegister', 'setAuthnRegister',
'd3GetMockableLogger', 'd3GetMockableLogger',
'd3GetMockableRegistryObject' 'd3GetMockableRegistryObject',
]) ])
->getMock(); ->getMock();
$sutMock->expects($this->atLeastOnce())->method('setPageType'); $sutMock->expects($this->atLeastOnce())->method('setPageType');
@ -566,7 +566,7 @@ class d3user_webauthnTest extends TestCase
public function canDeleteDataProvider(): array public function canDeleteDataProvider(): array
{ {
return [ return [
'has delete id' => ['deleteId', $this->once()] 'has delete id' => ['deleteId', $this->once()],
]; ];
} }
} }

View File

@ -61,7 +61,8 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
* @return void * @return void
*/ */
public function canGetNavigationParams() public function canGetNavigationParams()
{} {
}
/** /**
* @test * @test
@ -78,7 +79,7 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
->getMock(); ->getMock();
$sessionMock->method('hasVariable')->willReturnMap([ $sessionMock->method('hasVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH, $auth], [WebauthnConf::WEBAUTHN_ADMIN_SESSION_AUTH, $auth],
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $userFromLogin] [WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $userFromLogin],
]); ]);
/** @var Utils|MockObject $utilsMock */ /** @var Utils|MockObject $utilsMock */
@ -97,7 +98,7 @@ class d3webauthnadminloginTest extends d3webauthnloginTest
/** @var d3webauthnlogin|MockObject $sut */ /** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName) $sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction', 'd3GetMockableOxNewObject', ->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction', 'd3GetMockableOxNewObject',
'generateCredentialRequest', 'addTplParam']) 'generateCredentialRequest', 'addTplParam', ])
->getMock(); ->getMock();
$sut->method('d3GetMockableRegistryObject')->willReturnCallback( $sut->method('d3GetMockableRegistryObject')->willReturnCallback(
function () use ($utilsMock, $sessionMock) { function () use ($utilsMock, $sessionMock) {

View File

@ -47,7 +47,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable']) ->onlyMethods(['getVariable'])
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturn([ $sessionMock->method('getVariable')->willReturn([
'key1' => 'variable1' 'key1' => 'variable1',
]); ]);
/** @var d3webauthnlogin|MockObject $sut */ /** @var d3webauthnlogin|MockObject $sut */
@ -71,7 +71,7 @@ class d3webauthnloginTest extends UnitTestCase
[ [
'defKey1' => 'devValues1', 'defKey1' => 'devValues1',
'key1' => 'variable1', 'key1' => 'variable1',
'cl' => NULL, 'cl' => null,
], ],
$this->callMethod( $this->callMethod(
$sut, $sut,
@ -99,7 +99,7 @@ class d3webauthnloginTest extends UnitTestCase
->getMock(); ->getMock();
$sessionMock->method('hasVariable')->willReturnMap([ $sessionMock->method('hasVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_SESSION_AUTH, $auth], [WebauthnConf::WEBAUTHN_SESSION_AUTH, $auth],
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $userFromLogin] [WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $userFromLogin],
]); ]);
/** @var Utils|MockObject $utilsMock */ /** @var Utils|MockObject $utilsMock */
@ -112,7 +112,7 @@ class d3webauthnloginTest extends UnitTestCase
/** @var d3webauthnlogin|MockObject $sut */ /** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName) $sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction', ->onlyMethods(['d3GetMockableRegistryObject', 'd3CallMockableFunction',
'generateCredentialRequest', 'addTplParam']) 'generateCredentialRequest', 'addTplParam', ])
->getMock(); ->getMock();
$sut->method('d3GetMockableRegistryObject')->willReturnCallback( $sut->method('d3GetMockableRegistryObject')->willReturnCallback(
function () use ($utilsMock, $sessionMock) { function () use ($utilsMock, $sessionMock) {
@ -174,7 +174,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable']) ->onlyMethods(['getVariable'])
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturnMap([ $sessionMock->method('getVariable')->willReturnMap([
[$userSessionVarName, $currUserFixture] [$userSessionVarName, $currUserFixture],
]); ]);
/** @var Webauthn|MockObject $webAuthnMock */ /** @var Webauthn|MockObject $webAuthnMock */
@ -240,7 +240,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable', 'setVariable']) ->onlyMethods(['getVariable', 'setVariable'])
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturnMap([ $sessionMock->method('getVariable')->willReturnMap([
[$userVarName, $currUserFixture] [$userVarName, $currUserFixture],
]); ]);
$sessionMock->expects($this->once())->method('setVariable')->with(WebauthnConf::GLOBAL_SWITCH) $sessionMock->expects($this->once())->method('setVariable')->with(WebauthnConf::GLOBAL_SWITCH)
->willReturn(true); ->willReturn(true);
@ -262,7 +262,7 @@ class d3webauthnloginTest extends UnitTestCase
/** @var d3webauthnlogin|MockObject $sut */ /** @var d3webauthnlogin|MockObject $sut */
$sut = $this->getMockBuilder($this->sutClassName) $sut = $this->getMockBuilder($this->sutClassName)
->onlyMethods(['d3GetMockableOxNewObject', 'addTplParam', ->onlyMethods(['d3GetMockableOxNewObject', 'addTplParam',
'd3GetMockableLogger', 'd3GetMockableRegistryObject']) 'd3GetMockableLogger', 'd3GetMockableRegistryObject', ])
->getMock(); ->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback( $sut->method('d3GetMockableOxNewObject')->willReturnCallback(
function () use ($webAuthnMock) { function () use ($webAuthnMock) {
@ -313,7 +313,7 @@ class d3webauthnloginTest extends UnitTestCase
->onlyMethods(['getVariable']) ->onlyMethods(['getVariable'])
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturnMap([ $sessionMock->method('getVariable')->willReturnMap([
[$sessionVarName, $currClassFixture] [$sessionVarName, $currClassFixture],
]); ]);
/** @var d3webauthnlogin|MockObject $sut */ /** @var d3webauthnlogin|MockObject $sut */
@ -410,7 +410,7 @@ class d3webauthnloginTest extends UnitTestCase
{ {
return [ return [
[true], [true],
[false] [false],
]; ];
} }

View File

@ -105,7 +105,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid); $pkc->setId($oxid);
$pkc->assign([ $pkc->assign([
'credentialid' => base64_encode('myCredentialId'), 'credentialid' => base64_encode('myCredentialId'),
'oxshopid' => 55 'oxshopid' => 55,
]); ]);
$pkc->setCredential($pkcsMock); $pkc->setCredential($pkcsMock);
$pkc->save(); $pkc->save();
@ -132,7 +132,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
{ {
return [ return [
'existing' => [true, 'pkcsource'], 'existing' => [true, 'pkcsource'],
'not existing' => [false, null] 'not existing' => [false, null],
]; ];
} }
@ -185,7 +185,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid); $pkc->setId($oxid);
$pkc->assign([ $pkc->assign([
'oxuserid' => 'userid', 'oxuserid' => 'userid',
'oxshopid' => 55 'oxshopid' => 55,
]); ]);
$pkc->setCredential($pkcsMock); $pkc->setCredential($pkcsMock);
$pkc->save(); $pkc->save();
@ -271,7 +271,7 @@ class PublicKeyCredentialListTest extends UnitTestCase
$pkc->setId($oxid); $pkc->setId($oxid);
$pkc->assign([ $pkc->assign([
'oxuserid' => 'userid', 'oxuserid' => 'userid',
'oxshopid' => 55 'oxshopid' => 55,
]); ]);
$pkc->setCredential($pkcsMock); $pkc->setCredential($pkcsMock);
$pkc->save(); $pkc->save();

View File

@ -86,7 +86,7 @@ class PublicKeyCredentialTest extends UnitTestCase
/** @var PublicKeyCredential $sut */ /** @var PublicKeyCredential $sut */
$sut = oxNew(PublicKeyCredential::class); $sut = oxNew(PublicKeyCredential::class);
$sut->assign([ $sut->assign([
$fieldName => $setValue $fieldName => $setValue,
]); ]);
$this->assertEquals( $this->assertEquals(
@ -318,7 +318,7 @@ class PublicKeyCredentialTest extends UnitTestCase
$sut->setId($oxid); $sut->setId($oxid);
$sut->assign([ $sut->assign([
'credentialid' => base64_encode($pkcId), 'credentialid' => base64_encode($pkcId),
'oxshopid' => $shopId 'oxshopid' => $shopId,
]); ]);
$sut->save(); $sut->save();
} }
@ -344,7 +344,7 @@ class PublicKeyCredentialTest extends UnitTestCase
{ {
return [ return [
'item exists' => [true, 'idFixture'], 'item exists' => [true, 'idFixture'],
'item not exists' => [false, null] 'item not exists' => [false, null],
]; ];
} }
} }

View File

@ -48,7 +48,7 @@ class WebauthnExceptionTest extends UnitTestCase
/** @var WebauthnException|MockObject $sut */ /** @var WebauthnException|MockObject $sut */
$sut = $this->getMockBuilder(WebauthnException::class) $sut = $this->getMockBuilder(WebauthnException::class)
->onlyMethods(['setDetailedErrorMessage', 'getErrorMessageTranslator', 'getRequestType', ->onlyMethods(['setDetailedErrorMessage', 'getErrorMessageTranslator', 'getRequestType',
'd3CallMockableFunction']) 'd3CallMockableFunction', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->expects($this->once())->method('setDetailedErrorMessage'); $sut->expects($this->once())->method('setDetailedErrorMessage');
@ -150,7 +150,7 @@ class WebauthnExceptionTest extends UnitTestCase
{ {
return [ return [
'message is string' => ['errorMessageFixture'], 'message is string' => ['errorMessageFixture'],
'message is null' => [null] 'message is null' => [null],
]; ];
} }
} }

View File

@ -96,7 +96,7 @@ class RelyingPartyEntityTest extends TestCase
'null' => [null, false], 'null' => [null, false],
'empty string' => ['', false], 'empty string' => ['', false],
'space string' => [' ', false], 'space string' => [' ', false],
'non empty string' => ['content', true] 'non empty string' => ['content', true],
]; ];
} }
@ -222,7 +222,7 @@ class RelyingPartyEntityTest extends TestCase
{ {
return [ return [
'configured' => [true, ' subd.mydomain.com', 'www.myhost.de', 'subd.mydomain.com'], 'configured' => [true, ' subd.mydomain.com', 'www.myhost.de', 'subd.mydomain.com'],
'not configured'=> [false, ' subd.mydomain.com', 'www.myhost.de', 'www.myhost.de'] 'not configured'=> [false, ' subd.mydomain.com', 'www.myhost.de', 'www.myhost.de'],
]; ];
} }

View File

@ -59,7 +59,7 @@ class UserEntityTest extends UnitTestCase
$this->identicalTo([ $this->identicalTo([
'usernamefixture', 'usernamefixture',
'userId', 'userId',
'fNameFixture lNameFixture' 'fNameFixture lNameFixture',
]) ])
); );

View File

@ -66,7 +66,7 @@ class WebauthnAfterLoginTest extends UnitTestCase
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturnMap([ $sessionMock->method('getVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_ADMIN_PROFILE, $sessionProfile], [WebauthnConf::WEBAUTHN_ADMIN_PROFILE, $sessionProfile],
['aAdminProfiles', [['prof','No0'], ['prof', 'No1'], ['prof','No2']]] ['aAdminProfiles', [['prof','No0'], ['prof', 'No1'], ['prof','No2']]],
]); ]);
$sessionMock->expects($this->once())->method('deleteVariable'); $sessionMock->expects($this->once())->method('deleteVariable');
$sessionMock->expects($this->exactly((int) $setSessionVar))->method('setVariable'); $sessionMock->expects($this->exactly((int) $setSessionVar))->method('setVariable');
@ -210,7 +210,7 @@ class WebauthnAfterLoginTest extends UnitTestCase
$en_2->selected = 0; $en_2->selected = 0;
return [ return [
$de_1, $de_1,
$en_2 $en_2,
]; ];
} }

View File

@ -127,7 +127,7 @@ class WebauthnErrorsTest extends UnitTestCase
{ {
return [ return [
'with colon' => [' My Text With : Colon', 'my text with'], 'with colon' => [' My Text With : Colon', 'my text with'],
'without colon' => [' My Text With Colon', 'my text with colon'] 'without colon' => [' My Text With Colon', 'my text with colon'],
]; ];
} }
} }

View File

@ -216,7 +216,7 @@ class WebauthnLoginTest extends UnitTestCase
$sut = $this->getMockBuilder(WebauthnLogin::class) $sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', ->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie', 'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie',
'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId']) 'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->expects($this->exactly((int) $setCookie))->method('setSessionCookie'); $sut->expects($this->exactly((int) $setCookie))->method('setSessionCookie');
@ -281,7 +281,7 @@ class WebauthnLoginTest extends UnitTestCase
$sut = $this->getMockBuilder(WebauthnLogin::class) $sut = $this->getMockBuilder(WebauthnLogin::class)
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', 'd3GetMockableRegistryObject', ->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', 'd3GetMockableRegistryObject',
'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie', 'setFrontendSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setSessionCookie',
'd3GetMockableLogger', 'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId']) 'd3GetMockableLogger', 'd3GetMockableOxNewObject', 'getCredential', 'regenerateSessionId', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass)); $sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass));
@ -350,7 +350,7 @@ class WebauthnLoginTest extends UnitTestCase
$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',
'd3GetMockableOxNewObject']) 'd3GetMockableOxNewObject', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback( $sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -412,7 +412,7 @@ class WebauthnLoginTest extends UnitTestCase
->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn', ->onlyMethods(['getUserId', 'handleErrorMessage', 'assertUser', 'assertAuthn',
'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights', 'setAdminSession', 'handleBackendCookie', 'handleBackendSubshopRights',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject', 'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject',
'd3GetMockableLogger']) 'd3GetMockableLogger', ])
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass)); $sut->method('handleErrorMessage')->willThrowException(oxNew($exceptionClass));
@ -675,7 +675,7 @@ class WebauthnLoginTest extends UnitTestCase
{ {
return [ return [
'set cookie' => [true], 'set cookie' => [true],
'dont set cookie' => [false] 'dont set cookie' => [false],
]; ];
} }
@ -1065,10 +1065,11 @@ class WebauthnLoginTest extends UnitTestCase
$sessionMock->method('getVariable')->willReturnCallback( $sessionMock->method('getVariable')->willReturnCallback(
function () { function () {
$args = func_get_args(); $args = func_get_args();
if ($args[0] === WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER) if ($args[0] === WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER) {
return 'adminUser'; return 'adminUser';
elseif ($args[0] === WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER) } elseif ($args[0] === WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER) {
return 'frontendUser'; return 'frontendUser';
}
return null; return null;
} }
); );
@ -1126,11 +1127,11 @@ class WebauthnLoginTest extends UnitTestCase
$sessionMock->expects($this->exactly(2))->method('setVariable')->withConsecutive( $sessionMock->expects($this->exactly(2))->method('setVariable')->withConsecutive(
[ [
$this->identicalTo(WebauthnConf::WEBAUTHN_SESSION_AUTH), $this->identicalTo(WebauthnConf::WEBAUTHN_SESSION_AUTH),
$this->identicalTo('credentialFixture') $this->identicalTo('credentialFixture'),
], ],
[ [
$this->identicalTo(WebauthnConf::OXID_FRONTEND_AUTH), $this->identicalTo(WebauthnConf::OXID_FRONTEND_AUTH),
$this->identicalTo('idFixture') $this->identicalTo('idFixture'),
] ]
); );

View File

@ -107,7 +107,7 @@ class WebauthnTest extends UnitTestCase
'REMOTE_ADDR v6' => [null, null, null, '::1', true], 'REMOTE_ADDR v6' => [null, null, null, '::1', true],
'REMOTE_ADDR localhost' => [null, null, null, 'some.localhost', true], 'REMOTE_ADDR localhost' => [null, null, null, 'some.localhost', true],
'unset' => [null, null, null, null, false], 'unset' => [null, null, null, null, false],
'not valid' => ['off', 'http', 'off', '160.158.23.7', false] 'not valid' => ['off', 'http', 'off', '160.158.23.7', false],
]; ];
} }
@ -164,7 +164,7 @@ class WebauthnTest extends UnitTestCase
/** @var Webauthn|MockObject $sut */ /** @var Webauthn|MockObject $sut */
$sut = $this->getMockBuilder(Webauthn::class) $sut = $this->getMockBuilder(Webauthn::class)
->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode', ->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode',
'getExistingCredentials' 'getExistingCredentials',
]) ])
->getMock(); ->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback( $sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -192,7 +192,7 @@ class WebauthnTest extends UnitTestCase
); );
$sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn); $sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn);
$sut->expects($this->once())->method('getExistingCredentials')->willReturn([ $sut->expects($this->once())->method('getExistingCredentials')->willReturn([
$pubKeyCredDescriptorMock $pubKeyCredDescriptorMock,
]); ]);
if (!$jsonReturn) { if (!$jsonReturn) {
@ -361,7 +361,7 @@ class WebauthnTest extends UnitTestCase
/** @var Webauthn|MockObject $sut */ /** @var Webauthn|MockObject $sut */
$sut = $this->getMockBuilder(Webauthn::class) $sut = $this->getMockBuilder(Webauthn::class)
->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode', ->onlyMethods(['d3GetMockableOxNewObject', 'getServer', 'd3GetMockableRegistryObject', 'jsonEncode',
'getExistingCredentials' 'getExistingCredentials',
]) ])
->getMock(); ->getMock();
$sut->method('d3GetMockableOxNewObject')->willReturnCallback( $sut->method('d3GetMockableOxNewObject')->willReturnCallback(
@ -391,7 +391,7 @@ class WebauthnTest extends UnitTestCase
); );
$sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn); $sut->expects($this->once())->method('jsonEncode')->willReturn($jsonReturn);
$sut->expects($this->once())->method('getExistingCredentials')->willReturn([ $sut->expects($this->once())->method('getExistingCredentials')->willReturn([
$pubKeyCredDescriptorMock $pubKeyCredDescriptorMock,
]); ]);
if (!$jsonReturn) { if (!$jsonReturn) {
@ -695,7 +695,7 @@ class WebauthnTest extends UnitTestCase
$sessionMock->method('getVariable')->willReturnMap( $sessionMock->method('getVariable')->willReturnMap(
[ [
[WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $adminUser], [WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER, $adminUser],
[WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $frontendUser] [WebauthnConf::WEBAUTHN_SESSION_CURRENTUSER, $frontendUser],
] ]
); );
@ -732,7 +732,7 @@ class WebauthnTest extends UnitTestCase
{ {
return [ return [
'admin' => [true, 'admUsr', 'frontendUsr', 'admUsr'], 'admin' => [true, 'admUsr', 'frontendUsr', 'admUsr'],
'frontend' => [false, 'admUsr', 'frontendUsr', 'frontendUsr'] 'frontend' => [false, 'admUsr', 'frontendUsr', 'frontendUsr'],
]; ];
} }
@ -819,7 +819,7 @@ class WebauthnTest extends UnitTestCase
'user use webauthn, config disabled' => [true, false, true, false], 'user use webauthn, config disabled' => [true, false, true, false],
'user use webauthn, session disabled' => [false, true, true, false], 'user use webauthn, session disabled' => [false, true, true, false],
'user use webauthn, both disabled' => [true, true, true, false], 'user use webauthn, both disabled' => [true, true, true, false],
'user dont use ' => [false, false, false, false] 'user dont use ' => [false, false, false, false],
]; ];
} }

View File

@ -92,7 +92,7 @@ class UserComponentWebauthnTest extends UnitTestCase
->onlyMethods(['getRequestParameter']) ->onlyMethods(['getRequestParameter'])
->getMock(); ->getMock();
$requestMock->method('getRequestParameter')->willReturnMap([ $requestMock->method('getRequestParameter')->willReturnMap([
['lgn_usr', 'myUserName'] ['lgn_usr', 'myUserName'],
]); ]);
/** @var User|MockObject $userMock */ /** @var User|MockObject $userMock */
@ -112,7 +112,7 @@ class UserComponentWebauthnTest extends UnitTestCase
/** @var d3_webauthn_UserComponent|MockObject $sut */ /** @var d3_webauthn_UserComponent|MockObject $sut */
$sut = $this->getMockBuilder(UserComponent::class) $sut = $this->getMockBuilder(UserComponent::class)
->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'd3HasWebauthnButNotLoggedin', ->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'd3HasWebauthnButNotLoggedin',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject', 'getParent' 'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject', 'getParent',
]) ])
->getMock(); ->getMock();
$sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn); $sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn);
@ -433,7 +433,7 @@ class UserComponentWebauthnTest extends UnitTestCase
return [ return [
'passed' => [null, $this->once(), $this->never()], 'passed' => [null, $this->once(), $this->never()],
'webauthnException' => [WebauthnGetException::class, $this->never(), $this->once()], 'webauthnException' => [WebauthnGetException::class, $this->never(), $this->once()],
'webauthnLoginError' => [WebauthnLoginErrorException::class, $this->never(), $this->never()] 'webauthnLoginError' => [WebauthnLoginErrorException::class, $this->never(), $this->never()],
]; ];
} }
} }

View File

@ -228,7 +228,7 @@ class LoginControllerWebauthnTest extends UnitTestCase
->getMock(); ->getMock();
$requestMock->method('getRequestParameter')->willReturnMap([ $requestMock->method('getRequestParameter')->willReturnMap([
['user', 'myUserName'], ['user', 'myUserName'],
['profile', 'myProfile'] ['profile', 'myProfile'],
]); ]);
/** @var User|MockObject $userMock */ /** @var User|MockObject $userMock */
@ -248,7 +248,7 @@ class LoginControllerWebauthnTest extends UnitTestCase
/** @var LoginController|MockObject $sut */ /** @var LoginController|MockObject $sut */
$sut = $this->getMockBuilder(LoginController::class) $sut = $this->getMockBuilder(LoginController::class)
->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'hasWebauthnButNotLoggedin', ->onlyMethods(['d3CanUseWebauthn', 'd3CallMockableFunction', 'hasWebauthnButNotLoggedin',
'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject' 'd3GetMockableOxNewObject', 'd3GetMockableRegistryObject',
]) ])
->getMock(); ->getMock();
$sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn); $sut->method('d3CanUseWebauthn')->willReturn($canUseWebauthn);

View File

@ -58,7 +58,8 @@ class UserWebauthnTest extends UnitTestCase
/** @var d3_User_Webauthn $user */ /** @var d3_User_Webauthn $user */
$user = oxNew(User::class); $user = oxNew(User::class);
$user->delete($this->userId); $user->delete($this->userId);
} catch (Exception $e) {} } catch (Exception $e) {
}
} }
/** /**
@ -163,7 +164,7 @@ class UserWebauthnTest extends UnitTestCase
->getMock(); ->getMock();
$sessionMock->method('getVariable')->willReturnMap([ $sessionMock->method('getVariable')->willReturnMap([
[WebauthnConf::WEBAUTHN_SESSION_AUTH, $authInSession], [WebauthnConf::WEBAUTHN_SESSION_AUTH, $authInSession],
[WebauthnConf::WEBAUTHN_SESSION_LOGINUSER, $userNameInSession] [WebauthnConf::WEBAUTHN_SESSION_LOGINUSER, $userNameInSession],
]); ]);
/** @var User|MockObject $sut */ /** @var User|MockObject $sut */

View File

@ -569,7 +569,7 @@ class ActionsTest extends UnitTestCase
{ {
return [ return [
'has SEO url' => ['https://testshop.dev/securitykeys', true], 'has SEO url' => ['https://testshop.dev/securitykeys', true],
'has no SEO url'=> ['', false] 'has no SEO url'=> ['', false],
]; ];
} }