Passed
Push — master ( d67f1f...9f0579 )
by Aimeos
01:55
created

Typo3Test::testApply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2011
6
 * @copyright Aimeos (aimeos.org), 2014-2018
7
 */
8
9
10
namespace Aimeos\MW\Session;
11
12
13
require_once __DIR__ . DIRECTORY_SEPARATOR . 'AbstractUserAuthentication';
14
15
16
class Typo3Test extends \PHPUnit\Framework\TestCase
17
{
18
	private $object;
19
20
21
	protected function setUp()
22
	{
23
		$mock = new \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication();
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Core\Authentic...tractUserAuthentication 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...
24
		$this->object = new \Aimeos\MW\Session\Typo3($mock);
25
	}
26
27
28
	protected function tearDown()
29
	{
30
		unset($this->object);
31
	}
32
33
34
	public function testApply()
35
	{
36
		$this->object->apply( ['test' => '123456789', 'test2' => '987654321'] );
37
38
		$this->assertEquals( '123456789', $this->object->get( 'test' ) );
39
		$this->assertEquals( '987654321', $this->object->get( 'test2' ) );
40
	}
41
42
43
	public function testGet()
44
	{
45
		$this->assertEquals('', $this->object->get('test'));
46
47
		$this->object->set('test', '123456789');
48
		$this->assertEquals('123456789', $this->object->get('test'));
49
	}
50
51
52
	public function testSet()
53
	{
54
		$this->object->set('test', '123');
55
		$this->assertEquals( '123', $this->object->get( 'test' ) );
56
57
		$this->object->set('test', '234');
58
		$this->assertEquals( '234', $this->object->get( 'test' ) );
59
	}
60
}
61