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

Typo3Test::testSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
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