Completed
Push — master ( 2137d2...4a0d68 )
by Aimeos
10:40
created

FlowTest::testGetBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 7
loc 7
rs 9.4285
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 FlowTest extends \PHPUnit_Framework_TestCase
11
{
12
	private $object;
13
14
15
	protected function setUp()
16
	{
17
		if( !class_exists( '\TYPO3\Flow\Http\Request' ) ) {
18
			$this->markTestSkipped( '\TYPO3\Flow\Http\Request is not available' );
19
		}
20
21
		if( !class_exists( '\Zend\Diactoros\ServerRequestFactory' ) ) {
22
			$this->markTestSkipped( '\Zend\Diactoros\ServerRequestFactory is not available' );
23
		}
24
25
		$view = new \Aimeos\MW\View\Standard();
26
		$server = array( 'REMOTE_ADDR' => '127.0.0.1' );
27
		$request = new \TYPO3\Flow\Http\Request( array(), array(), array(), $server );
28
		$this->object = new \Aimeos\MW\View\Helper\Request\Flow( $view, $request, array(), array(), array(), array(), $server );
29
	}
30
31
32
	protected function tearDown()
33
	{
34
		unset( $this->object, $this->mock );
35
	}
36
37
38
	public function testTransform()
39
	{
40
		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Request\Flow', $this->object->transform() );
41
	}
42
43
44
	public function testGetClientAddress()
45
	{
46
		$this->assertEquals( '127.0.0.1', $this->object->getClientAddress() );
47
	}
48
49
50
	public function testGetTarget()
51
	{
52
		$this->assertEquals( null, $this->object->getTarget() );
53
	}
54
}
55