Completed
Push — master ( 76033c...306c32 )
by Aimeos
05:30
created
lib/custom/src/MW/View/Helper/Request/Symfony2.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	 * @param \Aimeos\MW\View\Iface $view View instance with registered view helpers
34 34
 	 * @param \Symfony\Component\HttpFoundation\Request $request Symfony2 request object
35 35
 	 */
36
-	public function __construct( $view, \Symfony\Component\HttpFoundation\Request $request )
36
+	public function __construct($view, \Symfony\Component\HttpFoundation\Request $request)
37 37
 	{
38
-		parent::__construct( $view, null, null, null, $request->files );
38
+		parent::__construct($view, null, null, null, $request->files);
39 39
 
40 40
 		$this->request = $request;
41 41
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function getTarget()
72 72
 	{
73
-		return $this->request->get( '_route' );
73
+		return $this->request->get('_route');
74 74
 	}
75 75
 
76 76
 
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 	 * @param \Traversable|array $files File upload data
81 81
 	 * @return array Multi-dimensional list of file objects
82 82
 	 */
83
-	protected function createUploadedFiles( $files )
83
+	protected function createUploadedFiles($files)
84 84
 	{
85 85
 		$files = array();
86 86
 
87
-		foreach( $files as $key => $value )
87
+		foreach ($files as $key => $value)
88 88
 		{
89
-			if( $value instanceof UploadedFile )
89
+			if ($value instanceof UploadedFile)
90 90
 			{
91 91
 				$files[$key] = new \Aimeos\MW\View\Helper\Request\File\Standard(
92 92
 					$value->getRealPath(),
Please login to merge, or discard this patch.
lib/custom/tests/MW/View/Helper/Request/Symfony2Test.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,51 +15,51 @@
 block discarded – undo
15 15
 
16 16
 	protected function setUp()
17 17
 	{
18
-		if( !class_exists( '\Symfony\Component\HttpFoundation\Request' ) ) {
19
-			$this->markTestSkipped( '\Symfony\Component\HttpFoundation\Request is not available' );
18
+		if (!class_exists('\Symfony\Component\HttpFoundation\Request')) {
19
+			$this->markTestSkipped('\Symfony\Component\HttpFoundation\Request is not available');
20 20
 		}
21 21
 
22 22
 		$view = new \Aimeos\MW\View\Standard();
23
-		$this->mock = $this->getMock( '\Symfony\Component\HttpFoundation\Request' );
24
-		$this->object = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $this->mock, array() );
23
+		$this->mock = $this->getMock('\Symfony\Component\HttpFoundation\Request');
24
+		$this->object = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $this->mock, array());
25 25
 	}
26 26
 
27 27
 
28 28
 	public function testTransform()
29 29
 	{
30
-		$this->assertInstanceOf( '\\Aimeos\\MW\\View\\Helper\\Request\\Symfony2', $this->object->transform() );
30
+		$this->assertInstanceOf('\\Aimeos\\MW\\View\\Helper\\Request\\Symfony2', $this->object->transform());
31 31
 	}
32 32
 
33 33
 
34 34
 	public function testGetBody()
35 35
 	{
36
-		$this->mock->expects( $this->once() )->method( 'getContent' )
37
-			->will( $this->returnValue( 'body' ) );
36
+		$this->mock->expects($this->once())->method('getContent')
37
+			->will($this->returnValue('body'));
38 38
 
39
-		$this->assertEquals( 'body', $this->object->transform()->getBody() );
39
+		$this->assertEquals('body', $this->object->transform()->getBody());
40 40
 	}
41 41
 
42 42
 
43 43
 	public function testGetClientAddress()
44 44
 	{
45
-		$this->mock->expects( $this->once() )->method( 'getClientIp' )
46
-			->will( $this->returnValue( '127.0.0.1' ) );
45
+		$this->mock->expects($this->once())->method('getClientIp')
46
+			->will($this->returnValue('127.0.0.1'));
47 47
 
48
-		$this->assertEquals( '127.0.0.1', $this->object->transform()->getClientAddress() );
48
+		$this->assertEquals('127.0.0.1', $this->object->transform()->getClientAddress());
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testGetTarget()
53 53
 	{
54
-		$this->mock->expects( $this->once() )->method( 'get' )
55
-			->will( $this->returnValue( 'test' ) );
54
+		$this->mock->expects($this->once())->method('get')
55
+			->will($this->returnValue('test'));
56 56
 
57
-		$this->assertEquals( 'test', $this->object->transform()->getTarget() );
57
+		$this->assertEquals('test', $this->object->transform()->getTarget());
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testGetUploadedFiles()
62 62
 	{
63
-		$this->assertEquals( array(), $this->object->transform()->getUploadedFiles() );
63
+		$this->assertEquals(array(), $this->object->transform()->getUploadedFiles());
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.