Typo3Test::setUp()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2021-2025
6
 */
7
8
9
namespace Aimeos\Base\Password;
10
11
12
class Typo3Test extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp() : void
18
	{
19
		if( !class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\Md5PasswordHash' ) ) {
20
			$this->markTestSkipped( 'TYPO3 password hashing not available' );
21
		}
22
23
		$this->object = new \Aimeos\Base\Password\Typo3( new \TYPO3\CMS\Core\Crypto\PasswordHashing\Md5PasswordHash() );
24
	}
25
26
27
	protected function tearDown() : void
28
	{
29
		unset( $this->object );
30
	}
31
32
33
	public function testHash()
34
	{
35
		$this->assertStringStartsWith( '$1$', $this->object->hash( 'unittest' ) );
36
	}
37
38
39
	public function testVerify()
40
	{
41
		$this->assertTrue( $this->object->verify( 'unittest', $this->object->hash( 'unittest' ) ) );
42
	}
43
}
44