first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace KupShop\AdminBundle\Tests;
use KupShop\AdminBundle\Util\LegacyAdminCredentials;
class AdminCredentialsTest extends \DatabaseTestCase
{
/** @var LegacyAdminCredentials */
private $legacyAdminCredentials;
protected function setUp(): void
{
parent::setUp();
$this->legacyAdminCredentials = $this->get(LegacyAdminCredentials::class);
}
/**
* @dataProvider data_testLoginByHash
*/
public function testLoginByHash(string $hash, bool $result): void
{
$loggedByHash = $this->legacyAdminCredentials->loginByHash($hash);
$logged = $this->legacyAdminCredentials->isLogged();
$this->assertEquals($result, (bool) $loggedByHash, 'Check that user was successfully logged in using hash');
$this->assertEquals($result, $logged, 'Check that user is logged globally');
}
public function data_testLoginByHash(): array
{
return [
['dasd115dsa1da2d', false],
['7b37429817eaed4', true],
];
}
}