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

LaravelTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
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