FlowTest::setUp()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 8
nc 4
nop 0
dl 0
loc 14
rs 10
c 0
b 0
f 0
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-2018
9
 */
10
class FlowTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase 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...
11
{
12
	private $object;
13
14
15
	protected function setUp()
16
	{
17
		if( !class_exists( '\Neos\Flow\Http\Request' ) ) {
18
			$this->markTestSkipped( '\Neos\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 \Neos\Flow\Http\Request( [], [], [], $server );
28
		$this->object = new \Aimeos\MW\View\Helper\Request\Flow( $view, $request, [], [], [], [], $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::class, $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