@@ -17,37 +17,37 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if( !interface_exists( '\\Illuminate\\Contracts\\Routing\\UrlGenerator' ) ) { |
|
21 | - $this->markTestSkipped( '\\Illuminate\\Contracts\\Routing\\UrlGenerator is not available' ); |
|
20 | + if (!interface_exists('\\Illuminate\\Contracts\\Routing\\UrlGenerator')) { |
|
21 | + $this->markTestSkipped('\\Illuminate\\Contracts\\Routing\\UrlGenerator is not available'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $view = new \Aimeos\MW\View\Standard(); |
25 | - $this->mock = $this->getMockBuilder( '\\Illuminate\\Contracts\\Routing\\UrlGenerator' )->getMock(); |
|
26 | - $this->object = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, $this->mock, [] ); |
|
25 | + $this->mock = $this->getMockBuilder('\\Illuminate\\Contracts\\Routing\\UrlGenerator')->getMock(); |
|
26 | + $this->object = new \Aimeos\MW\View\Helper\Url\Laravel5($view, $this->mock, []); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - unset( $this->object, $this->mock ); |
|
32 | + unset($this->object, $this->mock); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | public function testTransform() |
37 | 37 | { |
38 | - $this->mock->expects( $this->once() )->method( 'route' ) |
|
39 | - ->with( $this->equalTo( 'route'), $this->equalTo( array( 'key' => 'value' ) ), $this->equalTo( false ) ); |
|
38 | + $this->mock->expects($this->once())->method('route') |
|
39 | + ->with($this->equalTo('route'), $this->equalTo(array('key' => 'value')), $this->equalTo(false)); |
|
40 | 40 | |
41 | - $this->object->transform( 'route', 'catalog', 'lists', array( 'key' => 'value' ) ); |
|
41 | + $this->object->transform('route', 'catalog', 'lists', array('key' => 'value')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testTransformAbsolute() |
46 | 46 | { |
47 | - $this->mock->expects( $this->once() )->method( 'route' ) |
|
48 | - ->with( $this->equalTo( 'route'), $this->equalTo( [] ), $this->equalTo( true ) ); |
|
47 | + $this->mock->expects($this->once())->method('route') |
|
48 | + ->with($this->equalTo('route'), $this->equalTo([]), $this->equalTo(true)); |
|
49 | 49 | |
50 | - $options = array( 'absoluteUri' => true ); |
|
51 | - $this->object->transform( 'route', 'catalog', 'lists', [], [], $options ); |
|
50 | + $options = array('absoluteUri' => true); |
|
51 | + $this->object->transform('route', 'catalog', 'lists', [], [], $options); |
|
52 | 52 | } |
53 | 53 | } |
@@ -17,32 +17,32 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if( interface_exists( '\\Illuminate\\Session\\Store' ) === false ) { |
|
21 | - $this->markTestSkipped( 'Class \\Illuminate\\Session\\Store not found' ); |
|
20 | + if (interface_exists('\\Illuminate\\Session\\Store') === false) { |
|
21 | + $this->markTestSkipped('Class \\Illuminate\\Session\\Store not found'); |
|
22 | 22 | } |
23 | 23 | |
24 | - $this->mock = $this->getMockBuilder( '\\Illuminate\\Session\\Store' )->getMock(); |
|
25 | - $this->object = new \Aimeos\MW\Session\Laravel5( $this->mock ); |
|
24 | + $this->mock = $this->getMockBuilder('\\Illuminate\\Session\\Store')->getMock(); |
|
25 | + $this->object = new \Aimeos\MW\Session\Laravel5($this->mock); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | protected function tearDown() |
30 | 30 | { |
31 | - unset( $this->object ); |
|
31 | + unset($this->object); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | public function testGetDefault() |
36 | 36 | { |
37 | - $this->mock->expects( $this->once() )->method( 'get' )->with( $this->equalTo( 'notexist' ) ); |
|
38 | - $this->object->get( 'notexist' ); |
|
37 | + $this->mock->expects($this->once())->method('get')->with($this->equalTo('notexist')); |
|
38 | + $this->object->get('notexist'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testSet() |
43 | 43 | { |
44 | - $this->mock->expects( $this->once() )->method( 'put' ) |
|
45 | - ->with( $this->equalTo( 'key' ), $this->equalTo( 'value' ) ); |
|
46 | - $this->object->set( 'key', 'value' ); |
|
44 | + $this->mock->expects($this->once())->method('put') |
|
45 | + ->with($this->equalTo('key'), $this->equalTo('value')); |
|
46 | + $this->object->set('key', 'value'); |
|
47 | 47 | } |
48 | 48 | } |
@@ -17,53 +17,53 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if( interface_exists( '\\Illuminate\\Contracts\\Logging\\Log' ) === false ) { |
|
21 | - $this->markTestSkipped( 'Class \\Illuminate\\Contracts\\Logging\\Log not found' ); |
|
20 | + if (interface_exists('\\Illuminate\\Contracts\\Logging\\Log') === false) { |
|
21 | + $this->markTestSkipped('Class \\Illuminate\\Contracts\\Logging\\Log not found'); |
|
22 | 22 | } |
23 | 23 | |
24 | - $this->mock = $this->getMockBuilder( '\\Illuminate\\Contracts\\Logging\\Log' )->getMock(); |
|
25 | - $this->object = new \Aimeos\MW\Logger\Laravel5( $this->mock ); |
|
24 | + $this->mock = $this->getMockBuilder('\\Illuminate\\Contracts\\Logging\\Log')->getMock(); |
|
25 | + $this->object = new \Aimeos\MW\Logger\Laravel5($this->mock); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | protected function tearDown() |
30 | 30 | { |
31 | - unset( $this->mock, $this->object ); |
|
31 | + unset($this->mock, $this->object); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | public function testLog() |
36 | 36 | { |
37 | - $this->mock->expects( $this->once() )->method( 'log' ) |
|
38 | - ->with( $this->equalTo( 'msg' ), $this->equalTo( 'error' ) ); |
|
39 | - $this->object->log( 'msg' ); |
|
37 | + $this->mock->expects($this->once())->method('log') |
|
38 | + ->with($this->equalTo('msg'), $this->equalTo('error')); |
|
39 | + $this->object->log('msg'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testNonScalarLog() |
44 | 44 | { |
45 | - $this->mock->expects( $this->once() )->method( 'log' ) |
|
46 | - ->with( $this->equalTo( '["error","error2",2]' ), $this->equalTo( 'error' ) ); |
|
47 | - $this->object->log( array( 'error', 'error2', 2 ) ); |
|
45 | + $this->mock->expects($this->once())->method('log') |
|
46 | + ->with($this->equalTo('["error","error2",2]'), $this->equalTo('error')); |
|
47 | + $this->object->log(array('error', 'error2', 2)); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testLogDebug() |
52 | 52 | { |
53 | - $this->object->log( 'emergency', \Aimeos\MW\Logger\Base::EMERG ); |
|
54 | - $this->object->log( 'alert', \Aimeos\MW\Logger\Base::ALERT ); |
|
55 | - $this->object->log( 'critical', \Aimeos\MW\Logger\Base::CRIT ); |
|
56 | - $this->object->log( 'error', \Aimeos\MW\Logger\Base::ERR ); |
|
57 | - $this->object->log( 'warning', \Aimeos\MW\Logger\Base::WARN ); |
|
58 | - $this->object->log( 'notice', \Aimeos\MW\Logger\Base::NOTICE ); |
|
59 | - $this->object->log( 'info', \Aimeos\MW\Logger\Base::INFO ); |
|
60 | - $this->object->log( 'debug', \Aimeos\MW\Logger\Base::DEBUG ); |
|
53 | + $this->object->log('emergency', \Aimeos\MW\Logger\Base::EMERG); |
|
54 | + $this->object->log('alert', \Aimeos\MW\Logger\Base::ALERT); |
|
55 | + $this->object->log('critical', \Aimeos\MW\Logger\Base::CRIT); |
|
56 | + $this->object->log('error', \Aimeos\MW\Logger\Base::ERR); |
|
57 | + $this->object->log('warning', \Aimeos\MW\Logger\Base::WARN); |
|
58 | + $this->object->log('notice', \Aimeos\MW\Logger\Base::NOTICE); |
|
59 | + $this->object->log('info', \Aimeos\MW\Logger\Base::INFO); |
|
60 | + $this->object->log('debug', \Aimeos\MW\Logger\Base::DEBUG); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testBadPriority() |
65 | 65 | { |
66 | - $this->setExpectedException( '\\Aimeos\\MW\\Logger\\Exception' ); |
|
67 | - $this->object->log( 'error', -1 ); |
|
66 | + $this->setExpectedException('\\Aimeos\\MW\\Logger\\Exception'); |
|
67 | + $this->object->log('error', -1); |
|
68 | 68 | } |
69 | 69 | } |