Completed
Push — 2016.04 ( 690368...e61816 )
by Aimeos
04:37
created

Typo3Test   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 45
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
A setUp() 0 5 1
A testGet() 0 7 1
A testSet() 0 8 1
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
7
 */
8
9
10
namespace Aimeos\MW\Session;
11
12
13
require_once __DIR__ . DIRECTORY_SEPARATOR . 'FrontendUserAuthentication';
14
15
16
/**
17
 * Test class for \Aimeos\MW\Session\Typo3.
18
 */
19
class Typo3Test extends \PHPUnit_Framework_TestCase
20
{
21
	private $object;
22
23
24
	/**
25
	 * Sets up the fixture, for example, opens a network connection.
26
	 * This method is called before a test is executed.
27
	 *
28
	 * @access protected
29
	 */
30
	protected function setUp()
31
	{
32
		$mock = new \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication();
33
		$this->object = new \Aimeos\MW\Session\Typo3($mock);
34
	}
35
36
	/**
37
	 * Tears down the fixture, for example, closes a network connection.
38
	 * This method is called after a test is executed.
39
	 *
40
	 * @access protected
41
	 */
42
	protected function tearDown()
43
	{
44
		unset($this->object);
45
	}
46
47
	public function testGet()
48
	{
49
		$this->assertEquals('', $this->object->get('test'));
50
51
		$this->object->set('test', '123456789');
52
		$this->assertEquals('123456789', $this->object->get('test'));
53
	}
54
55
	public function testSet()
56
	{
57
		$this->object->set('test', '123');
58
		$this->assertEquals( '123', $this->object->get( 'test' ) );
59
60
		$this->object->set('test', '234');
61
		$this->assertEquals( '234', $this->object->get( 'test' ) );
62
	}
63
}
64