Passed
Branch master (ba77f4)
by Aimeos
03:57
created

TestPasswordHasherTypo3   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHashedPassword() 0 3 1
1
<?php
2
3
namespace Aimeos\MShop\Common\Helper\Password;
4
5
6
/**
7
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
8
 * @copyright Aimeos (aimeos.org), 2015-2018
9
 */
10
class Typo3Test extends \PHPUnit\Framework\TestCase
1 ignored issue
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
{
12
	public function testException()
13
	{
14
		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
15
		new \Aimeos\MShop\Common\Helper\Password\Typo3( [] );
16
	}
17
18
19
	public function testEncodeNull()
20
	{
21
		$object = new \Aimeos\MShop\Common\Helper\Password\Typo3( array( 'object' => null ) );
22
		$this->assertEquals( 'unittest', $object->encode( 'unittest', 'salt' ) );
23
	}
24
25
26
	public function testEncodeObject()
27
	{
28
		$object = new \Aimeos\MShop\Common\Helper\Password\Typo3( array( 'object' => new TestPasswordHasherTypo3() ) );
29
		$this->assertEquals( 'abcd', $object->encode( 'unittest', 'salt' ) );
30
	}
31
}
32
33
34
class TestPasswordHasherTypo3
35
{
36
	public function getHashedPassword( $password, $salt )
37
	{
38
		return 'abcd';
39
	}
40
}