@@ -21,88 +21,88 @@ |
||
| 21 | 21 | $context = \TestHelperJadm::getContext(); |
| 22 | 22 | $this->view = $context->getView(); |
| 23 | 23 | |
| 24 | - $this->stub = $this->getMockBuilder( '\\Aimeos\\Admin\\JsonAdm\\Standard' ) |
|
| 25 | - ->setConstructorArgs( array( $context, $this->view, [], 'attribute' ) ) |
|
| 24 | + $this->stub = $this->getMockBuilder('\\Aimeos\\Admin\\JsonAdm\\Standard') |
|
| 25 | + ->setConstructorArgs(array($context, $this->view, [], 'attribute')) |
|
| 26 | 26 | ->getMock(); |
| 27 | 27 | |
| 28 | - $this->object = $this->getMockBuilder( '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\Base' ) |
|
| 29 | - ->setConstructorArgs( [$this->stub, $context, $this->view, [], ''] ) |
|
| 28 | + $this->object = $this->getMockBuilder('\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\Base') |
|
| 29 | + ->setConstructorArgs([$this->stub, $context, $this->view, [], '']) |
|
| 30 | 30 | ->getMockForAbstractClass(); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | protected function tearDown() |
| 35 | 35 | { |
| 36 | - unset( $this->object, $this->stub, $this->view ); |
|
| 36 | + unset($this->object, $this->stub, $this->view); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testDelete() |
| 41 | 41 | { |
| 42 | - $this->stub->expects( $this->once() )->method( 'delete' )->will( $this->returnArgument( 1 ) ); |
|
| 42 | + $this->stub->expects($this->once())->method('delete')->will($this->returnArgument(1)); |
|
| 43 | 43 | $response = $this->view->response(); |
| 44 | 44 | |
| 45 | - $this->assertSame( $response, $this->object->delete( $this->view->request(), $response ) ); |
|
| 45 | + $this->assertSame($response, $this->object->delete($this->view->request(), $response)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGet() |
| 50 | 50 | { |
| 51 | - $this->stub->expects( $this->once() )->method( 'get' )->will( $this->returnArgument( 1 ) ); |
|
| 51 | + $this->stub->expects($this->once())->method('get')->will($this->returnArgument(1)); |
|
| 52 | 52 | $response = $this->view->response(); |
| 53 | 53 | |
| 54 | - $this->assertSame( $response, $this->object->get( $this->view->request(), $response ) ); |
|
| 54 | + $this->assertSame($response, $this->object->get($this->view->request(), $response)); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | public function testPatch() |
| 59 | 59 | { |
| 60 | - $this->stub->expects( $this->once() )->method( 'patch' )->will( $this->returnArgument( 1 ) ); |
|
| 60 | + $this->stub->expects($this->once())->method('patch')->will($this->returnArgument(1)); |
|
| 61 | 61 | $response = $this->view->response(); |
| 62 | 62 | |
| 63 | - $this->assertSame( $response, $this->object->patch( $this->view->request(), $response ) ); |
|
| 63 | + $this->assertSame($response, $this->object->patch($this->view->request(), $response)); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | public function testPost() |
| 68 | 68 | { |
| 69 | - $this->stub->expects( $this->once() )->method( 'post' )->will( $this->returnArgument( 1 ) ); |
|
| 69 | + $this->stub->expects($this->once())->method('post')->will($this->returnArgument(1)); |
|
| 70 | 70 | $response = $this->view->response(); |
| 71 | 71 | |
| 72 | - $this->assertSame( $response, $this->object->post( $this->view->request(), $response ) ); |
|
| 72 | + $this->assertSame($response, $this->object->post($this->view->request(), $response)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | public function testPut() |
| 77 | 77 | { |
| 78 | - $this->stub->expects( $this->once() )->method( 'put' )->will( $this->returnArgument( 1 ) ); |
|
| 78 | + $this->stub->expects($this->once())->method('put')->will($this->returnArgument(1)); |
|
| 79 | 79 | $response = $this->view->response(); |
| 80 | 80 | |
| 81 | - $this->assertSame( $response, $this->object->put( $this->view->request(), $response ) ); |
|
| 81 | + $this->assertSame($response, $this->object->put($this->view->request(), $response)); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | public function testOptions() |
| 86 | 86 | { |
| 87 | - $this->stub->expects( $this->once() )->method( 'options' )->will( $this->returnArgument( 1 ) ); |
|
| 87 | + $this->stub->expects($this->once())->method('options')->will($this->returnArgument(1)); |
|
| 88 | 88 | $response = $this->view->response(); |
| 89 | 89 | |
| 90 | - $this->assertSame( $response, $this->object->options( $this->view->request(), $response ) ); |
|
| 90 | + $this->assertSame($response, $this->object->options($this->view->request(), $response)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | public function testGetClient() |
| 95 | 95 | { |
| 96 | - $result = $this->access( 'getClient' )->invokeArgs( $this->object, [] ); |
|
| 97 | - $this->assertSame( $this->stub, $result ); |
|
| 96 | + $result = $this->access('getClient')->invokeArgs($this->object, []); |
|
| 97 | + $this->assertSame($this->stub, $result); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | - protected function access( $name ) |
|
| 101 | + protected function access($name) |
|
| 102 | 102 | { |
| 103 | - $class = new \ReflectionClass( \Aimeos\Admin\JsonAdm\Common\Decorator\Base::class ); |
|
| 104 | - $method = $class->getMethod( $name ); |
|
| 105 | - $method->setAccessible( true ); |
|
| 103 | + $class = new \ReflectionClass(\Aimeos\Admin\JsonAdm\Common\Decorator\Base::class); |
|
| 104 | + $method = $class->getMethod($name); |
|
| 105 | + $method->setAccessible(true); |
|
| 106 | 106 | |
| 107 | 107 | return $method; |
| 108 | 108 | } |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | ?> |
| 12 | 12 | { |
| 13 | 13 | "meta": { |
| 14 | - "total": <?= $this->get( 'total', 0 ); ?> |
|
| 14 | + "total": <?= $this->get('total', 0); ?> |
|
| 15 | 15 | |
| 16 | - <?php if( $this->csrf()->name() != '' ) : ?> |
|
| 16 | + <?php if ($this->csrf()->name() != '') : ?> |
|
| 17 | 17 | , "csrf": { |
| 18 | 18 | "name": "<?= $this->csrf()->name(); ?>", |
| 19 | 19 | "value": "<?= $this->csrf()->value(); ?>" |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - <?php if( isset( $this->errors ) ) : ?> |
|
| 25 | + <?php if (isset($this->errors)) : ?> |
|
| 26 | 26 | |
| 27 | - , "errors": <?= $this->partial( $this->config( 'admin/jsonadm/partials/template-errors', 'partials/errors-standard' ), array( 'errors' => $this->errors ) ); ?> |
|
| 27 | + , "errors": <?= $this->partial($this->config('admin/jsonadm/partials/template-errors', 'partials/errors-standard'), array('errors' => $this->errors)); ?> |
|
| 28 | 28 | |
| 29 | - <?php elseif( isset( $this->data ) ) : ?> |
|
| 29 | + <?php elseif (isset($this->data)) : ?> |
|
| 30 | 30 | |
| 31 | - , "data": <?= $this->partial( $this->config( 'admin/jsonadm/partials/template-data', 'partials/data-standard' ), array( 'data' => $this->get( 'data' ) ) ); ?> |
|
| 31 | + , "data": <?= $this->partial($this->config('admin/jsonadm/partials/template-data', 'partials/data-standard'), array('data' => $this->get('data'))); ?> |
|
| 32 | 32 | |
| 33 | 33 | <?php endif; ?> |
| 34 | 34 | |