@@ -12,50 +12,50 @@ |
||
12 | 12 | |
13 | 13 | protected function setUp() |
14 | 14 | { |
15 | - if( !class_exists( '\Illuminate\Filesystem\FilesystemManager' ) ) { |
|
16 | - $this->markTestSkipped( 'Install the Laravel framework first' ); |
|
15 | + if (!class_exists('\Illuminate\Filesystem\FilesystemManager')) { |
|
16 | + $this->markTestSkipped('Install the Laravel framework first'); |
|
17 | 17 | } |
18 | 18 | |
19 | - $this->storage = $this->getMockBuilder( '\Illuminate\Filesystem\FilesystemManager' ) |
|
20 | - ->setMethods( array( 'get' ) ) |
|
19 | + $this->storage = $this->getMockBuilder('\Illuminate\Filesystem\FilesystemManager') |
|
20 | + ->setMethods(array('get')) |
|
21 | 21 | ->disableOriginalConstructor() |
22 | 22 | ->getMock(); |
23 | 23 | |
24 | - $this->config = new \Aimeos\MW\Config\Decorator\Memory( new \Aimeos\MW\Config\PHPArray( array(), array() ) ); |
|
25 | - $this->object = new \Aimeos\MW\Filesystem\Manager\Laravel( $this->storage, $this->config, sys_get_temp_dir() ); |
|
24 | + $this->config = new \Aimeos\MW\Config\Decorator\Memory(new \Aimeos\MW\Config\PHPArray(array(), array())); |
|
25 | + $this->object = new \Aimeos\MW\Filesystem\Manager\Laravel($this->storage, $this->config, sys_get_temp_dir()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | protected function tearDown() |
30 | 30 | { |
31 | - unset( $this->config, $this->object, $this->storage ); |
|
31 | + unset($this->config, $this->object, $this->storage); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | public function testGet() |
36 | 36 | { |
37 | - $fs = $this->getMockBuilder( 'Illuminate\Contracts\Filesystem\Filesystem' ) |
|
37 | + $fs = $this->getMockBuilder('Illuminate\Contracts\Filesystem\Filesystem') |
|
38 | 38 | ->disableOriginalConstructor() |
39 | 39 | ->getMock(); |
40 | 40 | |
41 | - $this->storage->expects( $this->once() )->method( 'get' ) |
|
42 | - ->will( $this->returnValue( $fs ) ); |
|
41 | + $this->storage->expects($this->once())->method('get') |
|
42 | + ->will($this->returnValue($fs)); |
|
43 | 43 | |
44 | - $this->config->set( 'resource/fs-media', 'local' ); |
|
45 | - $this->assertInstanceof( 'Aimeos\MW\Filesystem\Iface', $this->object->get( 'fs-media' ) ); |
|
44 | + $this->config->set('resource/fs-media', 'local'); |
|
45 | + $this->assertInstanceof('Aimeos\MW\Filesystem\Iface', $this->object->get('fs-media')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetFallback() |
50 | 50 | { |
51 | - $this->config->set( 'resource/fs', array( 'adapter' => 'Standard', 'basedir' => __DIR__ ) ); |
|
52 | - $this->assertInstanceof( 'Aimeos\MW\Filesystem\Iface', $this->object->get( 'fs-media' ) ); |
|
51 | + $this->config->set('resource/fs', array('adapter' => 'Standard', 'basedir' => __DIR__)); |
|
52 | + $this->assertInstanceof('Aimeos\MW\Filesystem\Iface', $this->object->get('fs-media')); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testGetException() |
57 | 57 | { |
58 | - $this->setExpectedException( 'Aimeos\MW\Filesystem\Exception' ); |
|
59 | - $this->object->get( 'fs-media' ); |
|
58 | + $this->setExpectedException('Aimeos\MW\Filesystem\Exception'); |
|
59 | + $this->object->get('fs-media'); |
|
60 | 60 | } |
61 | 61 | } |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | */ |
22 | 22 | protected function setUp() |
23 | 23 | { |
24 | - if( !class_exists( '\\Illuminate\\Http\\Request' ) ) { |
|
25 | - $this->markTestSkipped( '\\Illuminate\\Http\\Request is not available' ); |
|
24 | + if (!class_exists('\\Illuminate\\Http\\Request')) { |
|
25 | + $this->markTestSkipped('\\Illuminate\\Http\\Request is not available'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $view = new \Aimeos\MW\View\Standard(); |
29 | 29 | |
30 | - $this->mock = $this->getMockBuilder( '\\Illuminate\\Http\\Request' ) |
|
31 | - ->setMethods( array( 'file' ) )->getMock(); |
|
30 | + $this->mock = $this->getMockBuilder('\\Illuminate\\Http\\Request') |
|
31 | + ->setMethods(array('file'))->getMock(); |
|
32 | 32 | |
33 | - $this->mock->expects( $this->once() )->method( 'file' )->will( $this->returnValue( array() ) ); |
|
33 | + $this->mock->expects($this->once())->method('file')->will($this->returnValue(array())); |
|
34 | 34 | |
35 | - $this->object = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, $this->mock ); |
|
35 | + $this->object = new \Aimeos\MW\View\Helper\Request\Laravel5($view, $this->mock); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -44,45 +44,45 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected function tearDown() |
46 | 46 | { |
47 | - unset( $this->object, $this->mock ); |
|
47 | + unset($this->object, $this->mock); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testTransform() |
52 | 52 | { |
53 | - $this->assertInstanceOf( '\\Aimeos\\MW\\View\\Helper\\Request\\Laravel5', $this->object->transform() ); |
|
53 | + $this->assertInstanceOf('\\Aimeos\\MW\\View\\Helper\\Request\\Laravel5', $this->object->transform()); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testGetBody() |
58 | 58 | { |
59 | - $this->mock->expects( $this->once() )->method( 'getContent' ) |
|
60 | - ->will( $this->returnValue( 'body' ) ); |
|
59 | + $this->mock->expects($this->once())->method('getContent') |
|
60 | + ->will($this->returnValue('body')); |
|
61 | 61 | |
62 | - $this->assertEquals( 'body', $this->object->transform()->getBody() ); |
|
62 | + $this->assertEquals('body', $this->object->transform()->getBody()); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | 66 | public function testGetClientAddress() |
67 | 67 | { |
68 | - $this->mock->expects( $this->once() )->method( 'ip' ) |
|
69 | - ->will( $this->returnValue( '127.0.0.1' ) ); |
|
68 | + $this->mock->expects($this->once())->method('ip') |
|
69 | + ->will($this->returnValue('127.0.0.1')); |
|
70 | 70 | |
71 | - $this->assertEquals( '127.0.0.1', $this->object->transform()->getClientAddress() ); |
|
71 | + $this->assertEquals('127.0.0.1', $this->object->transform()->getClientAddress()); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | public function testGetTarget() |
76 | 76 | { |
77 | - $this->mock->expects( $this->once() )->method( 'route' ) |
|
78 | - ->will( $this->returnValue( null ) ); |
|
77 | + $this->mock->expects($this->once())->method('route') |
|
78 | + ->will($this->returnValue(null)); |
|
79 | 79 | |
80 | - $this->assertEquals( null, $this->object->transform()->getTarget() ); |
|
80 | + $this->assertEquals(null, $this->object->transform()->getTarget()); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testGetUploadedFiles() |
85 | 85 | { |
86 | - $this->assertEquals( array(), $this->object->transform()->getUploadedFiles() ); |
|
86 | + $this->assertEquals(array(), $this->object->transform()->getUploadedFiles()); |
|
87 | 87 | } |
88 | 88 | } |