Completed
Push — master ( ec393a...539bbb )
by Aimeos
12:50
created

Symfony2Test::testGetUploadedFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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
9
 */
10
class Symfony2Test extends \PHPUnit_Framework_TestCase
11
{
12
	private $object;
13
	private $mock;
0 ignored issues
show
Unused Code introduced by
The property $mock is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
14
15
16
	protected function setUp()
17
	{
18
		if( !class_exists( '\Symfony\Component\HttpFoundation\Request' ) ) {
19
			$this->markTestSkipped( '\Symfony\Component\HttpFoundation\Request is not available' );
20
		}
21
22
		if( !class_exists( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' ) ) {
23
			$this->markTestSkipped( '\Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory is not available' );
24
		}
25
26
		$view = new \Aimeos\MW\View\Standard();
27
		$param = array( 'HTTP_HOST' => 'localhost', 'REMOTE_ADDR' => '127.0.0.1' );
28
		$request = new \Symfony\Component\HttpFoundation\Request( array(), array(), array(), array(), array(), $param, 'Content' );
29
		$this->object = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request );
30
	}
31
32
33
	public function testTransform()
34
	{
35
		$this->assertInstanceOf( '\Aimeos\MW\View\Helper\Request\Symfony2', $this->object->transform() );
36
	}
37
38
39
	public function testGetClientAddress()
40
	{
41
		$this->assertEquals( '127.0.0.1', $this->object->getClientAddress() );
42
	}
43
44
45
	public function testGetTarget()
46
	{
47
		$this->assertEquals( null, $this->object->getTarget() );
48
	}
49
}
50