Passed
Push — master ( 660cb3...58fd34 )
by Aimeos
03:38
created

LaravelTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testGetTarget() 0 3 1
A testTransform() 0 3 1
A testGetClientAddress() 0 3 1
A tearDown() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2022
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Request;
10
11
12
class LaravelTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
	private $mock;
16
17
18
	protected function setUp() : void
19
	{
20
		$view = new \Aimeos\Base\View\Standard();
21
		$param = array( 'HTTP_HOST' => 'localhost', 'REMOTE_ADDR' => '127.0.0.1' );
22
		$request = new \Illuminate\Http\Request( [], [], [], [], [], $param, 'Content' );
23
24
		$this->object = new \Aimeos\Base\View\Helper\Request\Laravel( $view, $request );
25
	}
26
27
28
	protected function tearDown() : void
29
	{
30
		unset( $this->object, $this->mock );
31
	}
32
33
34
	public function testTransform()
35
	{
36
		$this->assertInstanceOf( '\Aimeos\Base\View\Helper\Request\Laravel', $this->object->transform() );
37
	}
38
39
40
	public function testGetClientAddress()
41
	{
42
		$this->assertEquals( '127.0.0.1', $this->object->getClientAddress() );
43
	}
44
45
46
	public function testGetTarget()
47
	{
48
		$this->assertEquals( null, $this->object->getTarget() );
49
	}
50
}
51