oxtotp/src/tests/unit/Application/Model/d3RandomGeneratorTest.php

53 lines
1.2 KiB
PHP
Raw Normal View History

2019-08-11 00:33:59 +02:00
<?php
/**
2022-09-26 15:22:26 +02:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2019-08-11 00:33:59 +02:00
*
2022-09-26 15:22:26 +02:00
* https://www.d3data.de
2019-08-11 00:33:59 +02:00
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2022-09-26 15:22:26 +02:00
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
2019-08-11 00:33:59 +02:00
*/
namespace D3\Totp\tests\unit\Application\Model;
use D3\Totp\Application\Model\d3RandomGenerator;
use D3\Totp\tests\unit\d3TotpUnitTestCase;
use ReflectionException;
class d3RandomGeneratorTest extends d3TotpUnitTestCase
{
/** @var d3RandomGenerator */
protected $_oModel;
/**
* setup basic requirements
*/
public function setUp()
{
parent::setUp();
$this->_oModel = oxNew(d3RandomGenerator::class);
}
public function tearDown()
{
parent::tearDown();
unset($this->_oModel);
}
/**
* @test
* @throws ReflectionException
*/
public function getRandomTotpBackupCodeReturnsRightCode()
{
$this->assertRegExp(
'@[0-9]{6}@',
$this->callMethod($this->_oModel, 'getRandomTotpBackupCode')
);
}
}