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

Typo3Test   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 40
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 10 2
A tearDown() 0 4 1
A testTransform() 0 4 1
A testGetClientAddress() 0 4 1
A testGetTarget() 0 4 1
1
<?php
2
3
namespace Aimeos\MW\View\Helper\Request;
4
5
6
/**
7
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
8
 * @copyright Aimeos (aimeos.org), 2015-2016
9
 */
10
class Typo3Test extends \PHPUnit_Framework_TestCase
11
{
12
	private $object;
13
14
15
	protected function setUp()
16
	{
17
		if( !class_exists( '\Zend\Diactoros\ServerRequestFactory' ) ) {
18
			$this->markTestSkipped( '\Zend\Diactoros\ServerRequestFactory is not available' );
19
		}
20
21
		$view = new \Aimeos\MW\View\Standard();
22
		$server = array( 'REMOTE_ADDR' => '127.0.0.1' );
23
		$this->object = new \Aimeos\MW\View\Helper\Request\Typo3( $view, 123, array(), array(), array(), array(), $server );
24
	}
25
26
27
	protected function tearDown()
28
	{
29
		unset( $this->object );
30
	}
31
32
33
	public function testTransform()
34
	{
35
		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Request\Typo3', $this->object->transform() );
36
	}
37
38
39
	public function testGetClientAddress()
40
	{
41
		$this->assertEquals( '127.0.0.1', $this->object->getClientAddress() );
42
	}
43
44
45
	public function testGetTarget()
46
	{
47
		$this->assertEquals( 123, $this->object->getTarget() );
48
	}
49
}
50