/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Test/Unit/Model/CryptKeyGeneratorTest.php
48 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Setup\Test\Unit\Model; use Magento\Framework\Math\Random; use Magento\Setup\Model\CryptKeyGenerator; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** * Testcase for CryptKeyGenerator */ class CryptKeyGeneratorTest extends TestCase { /** * @var Random|MockObject */ private $randomMock; /** * @var CryptKeyGenerator */ private $cryptKeyGenerator; protected function setUp(): void { $this->randomMock = $this->getMockBuilder(Random::class) ->disableOriginalConstructor() ->getMock(); $this->cryptKeyGenerator = new CryptKeyGenerator($this->randomMock); } public function testStringForHashingIsReadFromRandom() { $this->randomMock ->expects($this->once()) ->method('getRandomBytes') ->willReturn(''); $this->cryptKeyGenerator->generate(); } }