SymfonyTest::testGetClientAddress()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Request;
10
11
12
class SymfonyTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
	private $mock;
0 ignored issues
show
introduced by
The private property $mock is not used, and could be removed.
Loading history...
16
17
18
	protected function setUp() : void
19
	{
20
		$view = new \Aimeos\Base\View\Standard();
21
		$files = array( 'test' => array( 'file' => array(
22
			'name' => 'test.txt',
23
			'type' => 'text/plain',
24
			'tmp_name' => tempnam( sys_get_temp_dir(), 'ai-symfony_' ),
25
			'error' => UPLOAD_ERR_OK,
26
			'size' => 123
27
		) ) );
28
		$param = array( 'HTTP_HOST' => 'localhost', 'REMOTE_ADDR' => '127.0.0.1' );
29
		$request = new \Symfony\Component\HttpFoundation\Request( [], [], [], [], $files, $param, 'Content' );
30
		$this->object = new \Aimeos\Base\View\Helper\Request\Symfony( $view, $request );
31
	}
32
33
34
	public function testTransform()
35
	{
36
		$this->assertInstanceOf( '\Aimeos\Base\View\Helper\Request\Symfony', $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