@@ -19,37 +19,37 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Basket\Mini\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Basket\Mini\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetHeader() |
| 34 | 34 | { |
| 35 | 35 | $output = $this->object->getHeader(); |
| 36 | - $this->assertNotNull( $output ); |
|
| 36 | + $this->assertNotNull($output); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetHeaderException() |
| 41 | 41 | { |
| 42 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Mini\Standard') |
|
| 43 | + ->setConstructorArgs(array($this->context, array())) |
|
| 44 | + ->setMethods(array('setViewParams')) |
|
| 45 | 45 | ->getMock(); |
| 46 | 46 | |
| 47 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 47 | + $object->expects($this->once())->method('setViewParams') |
|
| 48 | + ->will($this->throwException(new \Exception())); |
|
| 49 | 49 | |
| 50 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 50 | + $object->setView(\TestHelperHtml::getView()); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 52 | + $this->assertEquals(null, $object->getHeader()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -57,77 +57,77 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $output = $this->object->getBody(); |
| 59 | 59 | $miniBasket = $this->object->getView()->miniBasket; |
| 60 | - $this->assertTrue( $miniBasket instanceof \Aimeos\MShop\Order\Item\Base\Iface ); |
|
| 61 | - $this->assertStringStartsWith( '<section class="aimeos basket-mini">', $output ); |
|
| 60 | + $this->assertTrue($miniBasket instanceof \Aimeos\MShop\Order\Item\Base\Iface); |
|
| 61 | + $this->assertStringStartsWith('<section class="aimeos basket-mini">', $output); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | public function testGetBodyHtmlException() |
| 66 | 66 | { |
| 67 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' ) |
|
| 68 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 69 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 67 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Mini\Standard') |
|
| 68 | + ->setConstructorArgs(array($this->context, array())) |
|
| 69 | + ->setMethods(array('setViewParams')) |
|
| 70 | 70 | ->getMock(); |
| 71 | 71 | |
| 72 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 73 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 72 | + $object->expects($this->once())->method('setViewParams') |
|
| 73 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 74 | 74 | |
| 75 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 75 | + $object->setView(\TestHelperHtml::getView()); |
|
| 76 | 76 | |
| 77 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 77 | + $this->assertContains('test exception', $object->getBody()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | public function testGetBodyFrontendException() |
| 82 | 82 | { |
| 83 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' ) |
|
| 84 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 85 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 83 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Mini\Standard') |
|
| 84 | + ->setConstructorArgs(array($this->context, array())) |
|
| 85 | + ->setMethods(array('setViewParams')) |
|
| 86 | 86 | ->getMock(); |
| 87 | 87 | |
| 88 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 89 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 88 | + $object->expects($this->once())->method('setViewParams') |
|
| 89 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 90 | 90 | |
| 91 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 91 | + $object->setView(\TestHelperHtml::getView()); |
|
| 92 | 92 | |
| 93 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 93 | + $this->assertContains('test exception', $object->getBody()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | public function testGetBodyMShopException() |
| 98 | 98 | { |
| 99 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' ) |
|
| 100 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 101 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 99 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Mini\Standard') |
|
| 100 | + ->setConstructorArgs(array($this->context, array())) |
|
| 101 | + ->setMethods(array('setViewParams')) |
|
| 102 | 102 | ->getMock(); |
| 103 | 103 | |
| 104 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 105 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 104 | + $object->expects($this->once())->method('setViewParams') |
|
| 105 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 106 | 106 | |
| 107 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 107 | + $object->setView(\TestHelperHtml::getView()); |
|
| 108 | 108 | |
| 109 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 109 | + $this->assertContains('test exception', $object->getBody()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | public function testGetSubClient() |
| 114 | 114 | { |
| 115 | - $client = $this->object->getSubClient( 'main', 'Standard' ); |
|
| 116 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 115 | + $client = $this->object->getSubClient('main', 'Standard'); |
|
| 116 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | public function testGetSubClientInvalid() |
| 121 | 121 | { |
| 122 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 123 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 122 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 123 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetSubClientInvalidName() |
| 128 | 128 | { |
| 129 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 130 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 129 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 130 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -18,113 +18,113 @@ |
||
| 18 | 18 | $this->context = \TestHelperHtml::getContext(); |
| 19 | 19 | |
| 20 | 20 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 21 | - $this->object = new \Aimeos\Client\Html\Basket\Related\Standard( $this->context, $paths ); |
|
| 22 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 21 | + $this->object = new \Aimeos\Client\Html\Basket\Related\Standard($this->context, $paths); |
|
| 22 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - \Aimeos\Controller\Frontend\Basket\Factory::createController( $this->context )->clear(); |
|
| 29 | - unset( $this->object ); |
|
| 28 | + \Aimeos\Controller\Frontend\Basket\Factory::createController($this->context)->clear(); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetHeader() |
| 34 | 34 | { |
| 35 | 35 | $output = $this->object->getHeader(); |
| 36 | - $this->assertNotNull( $output ); |
|
| 36 | + $this->assertNotNull($output); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetHeaderException() |
| 41 | 41 | { |
| 42 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Related\Standard') |
|
| 43 | + ->setConstructorArgs(array($this->context, array())) |
|
| 44 | + ->setMethods(array('setViewParams')) |
|
| 45 | 45 | ->getMock(); |
| 46 | 46 | |
| 47 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 47 | + $object->expects($this->once())->method('setViewParams') |
|
| 48 | + ->will($this->throwException(new \Exception())); |
|
| 49 | 49 | |
| 50 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 50 | + $object->setView(\TestHelperHtml::getView()); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 52 | + $this->assertEquals(null, $object->getHeader()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public function testGetBody() |
| 57 | 57 | { |
| 58 | 58 | $output = $this->object->getBody(); |
| 59 | - $this->assertStringStartsWith( '<section class="aimeos basket-related">', $output ); |
|
| 59 | + $this->assertStringStartsWith('<section class="aimeos basket-related">', $output); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | public function testGetBodyHtmlException() |
| 64 | 64 | { |
| 65 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' ) |
|
| 66 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 67 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 65 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Related\Standard') |
|
| 66 | + ->setConstructorArgs(array($this->context, array())) |
|
| 67 | + ->setMethods(array('setViewParams')) |
|
| 68 | 68 | ->getMock(); |
| 69 | 69 | |
| 70 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 71 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 70 | + $object->expects($this->once())->method('setViewParams') |
|
| 71 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 72 | 72 | |
| 73 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 73 | + $object->setView(\TestHelperHtml::getView()); |
|
| 74 | 74 | |
| 75 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 75 | + $this->assertContains('test exception', $object->getBody()); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | public function testGetBodyFrontendException() |
| 80 | 80 | { |
| 81 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 83 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 81 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Related\Standard') |
|
| 82 | + ->setConstructorArgs(array($this->context, array())) |
|
| 83 | + ->setMethods(array('setViewParams')) |
|
| 84 | 84 | ->getMock(); |
| 85 | 85 | |
| 86 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 87 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 86 | + $object->expects($this->once())->method('setViewParams') |
|
| 87 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 88 | 88 | |
| 89 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 89 | + $object->setView(\TestHelperHtml::getView()); |
|
| 90 | 90 | |
| 91 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 91 | + $this->assertContains('test exception', $object->getBody()); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | public function testGetBodyMShopException() |
| 96 | 96 | { |
| 97 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' ) |
|
| 98 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 99 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 97 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Basket\Related\Standard') |
|
| 98 | + ->setConstructorArgs(array($this->context, array())) |
|
| 99 | + ->setMethods(array('setViewParams')) |
|
| 100 | 100 | ->getMock(); |
| 101 | 101 | |
| 102 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 103 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 102 | + $object->expects($this->once())->method('setViewParams') |
|
| 103 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 104 | 104 | |
| 105 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 105 | + $object->setView(\TestHelperHtml::getView()); |
|
| 106 | 106 | |
| 107 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 107 | + $this->assertContains('test exception', $object->getBody()); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | public function testGetSubClient() |
| 112 | 112 | { |
| 113 | - $client = $this->object->getSubClient( 'bought', 'Standard' ); |
|
| 114 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 113 | + $client = $this->object->getSubClient('bought', 'Standard'); |
|
| 114 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testGetSubClientInvalid() |
| 119 | 119 | { |
| 120 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 121 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 120 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 121 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | public function testGetSubClientInvalidName() |
| 126 | 126 | { |
| 127 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 128 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 127 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 128 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 129 | 129 | } |
| 130 | 130 | } |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 21 | 21 | |
| 22 | - $this->object = new \Aimeos\Client\Html\Locale\Select\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Locale\Select\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -34,129 +34,129 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $tags = array(); |
| 36 | 36 | $expire = null; |
| 37 | - $output = $this->object->getHeader( 1, $tags, $expire ); |
|
| 37 | + $output = $this->object->getHeader(1, $tags, $expire); |
|
| 38 | 38 | |
| 39 | - $this->assertNotNull( $output ); |
|
| 40 | - $this->assertEquals( null, $expire ); |
|
| 41 | - $this->assertEquals( 0, count( $tags ) ); |
|
| 39 | + $this->assertNotNull($output); |
|
| 40 | + $this->assertEquals(null, $expire); |
|
| 41 | + $this->assertEquals(0, count($tags)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testGetHeaderException() |
| 46 | 46 | { |
| 47 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' ) |
|
| 48 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 49 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 47 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Locale\Select\Standard') |
|
| 48 | + ->setConstructorArgs(array($this->context, array())) |
|
| 49 | + ->setMethods(array('setViewParams')) |
|
| 50 | 50 | ->getMock(); |
| 51 | 51 | |
| 52 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 53 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 52 | + $object->expects($this->once())->method('setViewParams') |
|
| 53 | + ->will($this->throwException(new \Exception())); |
|
| 54 | 54 | |
| 55 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 55 | + $object->setView(\TestHelperHtml::getView()); |
|
| 56 | 56 | |
| 57 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 57 | + $this->assertEquals(null, $object->getHeader()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testGetBody() |
| 62 | 62 | { |
| 63 | 63 | $view = $this->object->getView(); |
| 64 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
| 65 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' ); |
|
| 66 | - $view->addHelper( 'request', $helper ); |
|
| 64 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
| 65 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, $request, '127.0.0.1', 'test'); |
|
| 66 | + $view->addHelper('request', $helper); |
|
| 67 | 67 | |
| 68 | 68 | $tags = array(); |
| 69 | 69 | $expire = null; |
| 70 | - $output = $this->object->getBody( 1, $tags, $expire ); |
|
| 70 | + $output = $this->object->getBody(1, $tags, $expire); |
|
| 71 | 71 | |
| 72 | - $this->assertStringStartsWith( '<section class="aimeos locale-select">', $output ); |
|
| 73 | - $this->assertEquals( null, $expire ); |
|
| 74 | - $this->assertEquals( 0, count( $tags ) ); |
|
| 72 | + $this->assertStringStartsWith('<section class="aimeos locale-select">', $output); |
|
| 73 | + $this->assertEquals(null, $expire); |
|
| 74 | + $this->assertEquals(0, count($tags)); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testGetBodyHtmlException() |
| 79 | 79 | { |
| 80 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' ) |
|
| 81 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 82 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 80 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Locale\Select\Standard') |
|
| 81 | + ->setConstructorArgs(array($this->context, array())) |
|
| 82 | + ->setMethods(array('setViewParams')) |
|
| 83 | 83 | ->getMock(); |
| 84 | 84 | |
| 85 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 86 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 85 | + $object->expects($this->once())->method('setViewParams') |
|
| 86 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 87 | 87 | |
| 88 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 88 | + $object->setView(\TestHelperHtml::getView()); |
|
| 89 | 89 | |
| 90 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 90 | + $this->assertContains('test exception', $object->getBody()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | public function testGetBodyFrontendException() |
| 95 | 95 | { |
| 96 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' ) |
|
| 97 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 98 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 96 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Locale\Select\Standard') |
|
| 97 | + ->setConstructorArgs(array($this->context, array())) |
|
| 98 | + ->setMethods(array('setViewParams')) |
|
| 99 | 99 | ->getMock(); |
| 100 | 100 | |
| 101 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 102 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 101 | + $object->expects($this->once())->method('setViewParams') |
|
| 102 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 103 | 103 | |
| 104 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 104 | + $object->setView(\TestHelperHtml::getView()); |
|
| 105 | 105 | |
| 106 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 106 | + $this->assertContains('test exception', $object->getBody()); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | public function testGetBodyMShopException() |
| 111 | 111 | { |
| 112 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' ) |
|
| 113 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 114 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 112 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Locale\Select\Standard') |
|
| 113 | + ->setConstructorArgs(array($this->context, array())) |
|
| 114 | + ->setMethods(array('setViewParams')) |
|
| 115 | 115 | ->getMock(); |
| 116 | 116 | |
| 117 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 118 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 117 | + $object->expects($this->once())->method('setViewParams') |
|
| 118 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 119 | 119 | |
| 120 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 120 | + $object->setView(\TestHelperHtml::getView()); |
|
| 121 | 121 | |
| 122 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 122 | + $this->assertContains('test exception', $object->getBody()); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
| 126 | 126 | public function testGetBodyException() |
| 127 | 127 | { |
| 128 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' ) |
|
| 129 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 130 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 128 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Locale\Select\Standard') |
|
| 129 | + ->setConstructorArgs(array($this->context, array())) |
|
| 130 | + ->setMethods(array('setViewParams')) |
|
| 131 | 131 | ->getMock(); |
| 132 | 132 | |
| 133 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 134 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 133 | + $object->expects($this->once())->method('setViewParams') |
|
| 134 | + ->will($this->throwException(new \Exception())); |
|
| 135 | 135 | |
| 136 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 136 | + $object->setView(\TestHelperHtml::getView()); |
|
| 137 | 137 | |
| 138 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 138 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | public function testGetSubClient() |
| 143 | 143 | { |
| 144 | - $client = $this->object->getSubClient( 'language', 'Standard' ); |
|
| 145 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 144 | + $client = $this->object->getSubClient('language', 'Standard'); |
|
| 145 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | public function testGetSubClientInvalid() |
| 150 | 150 | { |
| 151 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 152 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 151 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 152 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | public function testGetSubClientInvalidName() |
| 157 | 157 | { |
| 158 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 159 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 158 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 159 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | $this->context = \TestHelperHtml::getContext(); |
| 26 | 26 | |
| 27 | 27 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 28 | - $this->object = new \Aimeos\Client\Html\Catalog\Stage\Standard( $this->context, $paths ); |
|
| 29 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 28 | + $this->object = new \Aimeos\Client\Html\Catalog\Stage\Standard($this->context, $paths); |
|
| 29 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -38,39 +38,39 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | protected function tearDown() |
| 40 | 40 | { |
| 41 | - unset( $this->object ); |
|
| 41 | + unset($this->object); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testGetHeader() |
| 46 | 46 | { |
| 47 | 47 | $view = $this->object->getView(); |
| 48 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) ); |
|
| 49 | - $view->addHelper( 'param', $helper ); |
|
| 48 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_catid' => $this->getCatalogItem()->getId())); |
|
| 49 | + $view->addHelper('param', $helper); |
|
| 50 | 50 | |
| 51 | 51 | $tags = array(); |
| 52 | 52 | $expire = null; |
| 53 | - $output = $this->object->getHeader( 1, $tags, $expire ); |
|
| 53 | + $output = $this->object->getHeader(1, $tags, $expire); |
|
| 54 | 54 | |
| 55 | - $this->assertNotNull( $output ); |
|
| 56 | - $this->assertEquals( '2019-01-01 00:00:00', $expire ); |
|
| 57 | - $this->assertEquals( 1, count( $tags ) ); |
|
| 55 | + $this->assertNotNull($output); |
|
| 56 | + $this->assertEquals('2019-01-01 00:00:00', $expire); |
|
| 57 | + $this->assertEquals(1, count($tags)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | public function testGetHeaderException() |
| 62 | 62 | { |
| 63 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' ) |
|
| 64 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 65 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 63 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stage\Standard') |
|
| 64 | + ->setConstructorArgs(array($this->context, array())) |
|
| 65 | + ->setMethods(array('setViewParams')) |
|
| 66 | 66 | ->getMock(); |
| 67 | 67 | |
| 68 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 69 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 68 | + $object->expects($this->once())->method('setViewParams') |
|
| 69 | + ->will($this->throwException(new \Exception())); |
|
| 70 | 70 | |
| 71 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 71 | + $object->setView(\TestHelperHtml::getView()); |
|
| 72 | 72 | |
| 73 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 73 | + $this->assertEquals(null, $object->getHeader()); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -78,108 +78,108 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $tags = array(); |
| 80 | 80 | $expire = null; |
| 81 | - $output = $this->object->getBody( 1, $tags, $expire ); |
|
| 81 | + $output = $this->object->getBody(1, $tags, $expire); |
|
| 82 | 82 | |
| 83 | - $this->assertStringStartsWith( '<section class="aimeos catalog-stage">', $output ); |
|
| 84 | - $this->assertEquals( null, $expire ); |
|
| 85 | - $this->assertEquals( 0, count( $tags ) ); |
|
| 83 | + $this->assertStringStartsWith('<section class="aimeos catalog-stage">', $output); |
|
| 84 | + $this->assertEquals(null, $expire); |
|
| 85 | + $this->assertEquals(0, count($tags)); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function testGetBodyCatId() |
| 90 | 90 | { |
| 91 | 91 | $view = $this->object->getView(); |
| 92 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) ); |
|
| 93 | - $view->addHelper( 'param', $helper ); |
|
| 92 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_catid' => $this->getCatalogItem()->getId())); |
|
| 93 | + $view->addHelper('param', $helper); |
|
| 94 | 94 | |
| 95 | 95 | $tags = array(); |
| 96 | 96 | $expire = null; |
| 97 | - $output = $this->object->getBody( 1, $tags, $expire ); |
|
| 97 | + $output = $this->object->getBody(1, $tags, $expire); |
|
| 98 | 98 | |
| 99 | - $this->assertStringStartsWith( '<section class="aimeos catalog-stage home categories coffee">', $output ); |
|
| 100 | - $this->assertEquals( '2019-01-01 00:00:00', $expire ); |
|
| 101 | - $this->assertEquals( 1, count( $tags ) ); |
|
| 99 | + $this->assertStringStartsWith('<section class="aimeos catalog-stage home categories coffee">', $output); |
|
| 100 | + $this->assertEquals('2019-01-01 00:00:00', $expire); |
|
| 101 | + $this->assertEquals(1, count($tags)); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | public function testGetBodyHtmlException() |
| 106 | 106 | { |
| 107 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' ) |
|
| 108 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 109 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 107 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stage\Standard') |
|
| 108 | + ->setConstructorArgs(array($this->context, array())) |
|
| 109 | + ->setMethods(array('setViewParams')) |
|
| 110 | 110 | ->getMock(); |
| 111 | 111 | |
| 112 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 113 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 112 | + $object->expects($this->once())->method('setViewParams') |
|
| 113 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 114 | 114 | |
| 115 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 115 | + $object->setView(\TestHelperHtml::getView()); |
|
| 116 | 116 | |
| 117 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 117 | + $this->assertContains('test exception', $object->getBody()); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | public function testGetBodyFrontendException() |
| 122 | 122 | { |
| 123 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' ) |
|
| 124 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 125 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 123 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stage\Standard') |
|
| 124 | + ->setConstructorArgs(array($this->context, array())) |
|
| 125 | + ->setMethods(array('setViewParams')) |
|
| 126 | 126 | ->getMock(); |
| 127 | 127 | |
| 128 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 129 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 128 | + $object->expects($this->once())->method('setViewParams') |
|
| 129 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 130 | 130 | |
| 131 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 131 | + $object->setView(\TestHelperHtml::getView()); |
|
| 132 | 132 | |
| 133 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 133 | + $this->assertContains('test exception', $object->getBody()); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | public function testGetBodyMShopException() |
| 138 | 138 | { |
| 139 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' ) |
|
| 140 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 141 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 139 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stage\Standard') |
|
| 140 | + ->setConstructorArgs(array($this->context, array())) |
|
| 141 | + ->setMethods(array('setViewParams')) |
|
| 142 | 142 | ->getMock(); |
| 143 | 143 | |
| 144 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 145 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 144 | + $object->expects($this->once())->method('setViewParams') |
|
| 145 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 146 | 146 | |
| 147 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 147 | + $object->setView(\TestHelperHtml::getView()); |
|
| 148 | 148 | |
| 149 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 149 | + $this->assertContains('test exception', $object->getBody()); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | public function testModifyBody() |
| 154 | 154 | { |
| 155 | - $this->assertEquals( 'test', $this->object->modifyBody( 'test', 1 ) ); |
|
| 155 | + $this->assertEquals('test', $this->object->modifyBody('test', 1)); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | public function testModifyHeader() |
| 160 | 160 | { |
| 161 | - $this->assertEquals( 'test', $this->object->modifyHeader( 'test', 1 ) ); |
|
| 161 | + $this->assertEquals('test', $this->object->modifyHeader('test', 1)); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | public function testGetSubClient() |
| 166 | 166 | { |
| 167 | - $client = $this->object->getSubClient( 'image', 'Standard' ); |
|
| 168 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 167 | + $client = $this->object->getSubClient('image', 'Standard'); |
|
| 168 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | public function testGetSubClientInvalid() |
| 173 | 173 | { |
| 174 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 175 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 174 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 175 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | public function testGetSubClientInvalidName() |
| 180 | 180 | { |
| 181 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 182 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 181 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 182 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | protected function getCatalogItem() |
| 193 | 193 | { |
| 194 | - $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
| 194 | + $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
| 195 | 195 | $search = $catalogManager->createSearch(); |
| 196 | - $search->setConditions( $search->compare( '==', 'catalog.code', 'cafe' ) ); |
|
| 197 | - $items = $catalogManager->searchItems( $search ); |
|
| 196 | + $search->setConditions($search->compare('==', 'catalog.code', 'cafe')); |
|
| 197 | + $items = $catalogManager->searchItems($search); |
|
| 198 | 198 | |
| 199 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 200 | - throw new \Exception( 'No catalog item with code "cafe" found' ); |
|
| 199 | + if (($item = reset($items)) === false) { |
|
| 200 | + throw new \Exception('No catalog item with code "cafe" found'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $item; |
@@ -19,37 +19,37 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Catalog\Stock\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Catalog\Stock\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetHeader() |
| 34 | 34 | { |
| 35 | 35 | $output = $this->object->getHeader(); |
| 36 | - $this->assertNotNull( $output ); |
|
| 36 | + $this->assertNotNull($output); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetHeaderException() |
| 41 | 41 | { |
| 42 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stock\Standard') |
|
| 43 | + ->setConstructorArgs(array($this->context, array())) |
|
| 44 | + ->setMethods(array('setViewParams')) |
|
| 45 | 45 | ->getMock(); |
| 46 | 46 | |
| 47 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 47 | + $object->expects($this->once())->method('setViewParams') |
|
| 48 | + ->will($this->throwException(new \Exception())); |
|
| 49 | 49 | |
| 50 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 50 | + $object->setView(\TestHelperHtml::getView()); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 52 | + $this->assertEquals(null, $object->getHeader()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -58,64 +58,64 @@ discard block |
||
| 58 | 58 | $productId = $this->getProductItem()->getId(); |
| 59 | 59 | |
| 60 | 60 | $view = $this->object->getView(); |
| 61 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => $productId ) ); |
|
| 62 | - $view->addHelper( 'param', $helper ); |
|
| 61 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('s_prodid' => $productId)); |
|
| 62 | + $view->addHelper('param', $helper); |
|
| 63 | 63 | |
| 64 | 64 | $output = $this->object->getBody(); |
| 65 | - $this->assertRegExp( '/"' . $productId . '".*stock-high/', $output ); |
|
| 65 | + $this->assertRegExp('/"'.$productId.'".*stock-high/', $output); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testGetBodyStockUnlimited() |
| 70 | 70 | { |
| 71 | 71 | $view = $this->object->getView(); |
| 72 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => -1 ) ); |
|
| 73 | - $view->addHelper( 'param', $helper ); |
|
| 72 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('s_prodid' => -1)); |
|
| 73 | + $view->addHelper('param', $helper); |
|
| 74 | 74 | |
| 75 | 75 | $output = $this->object->getBody(); |
| 76 | - $this->assertRegExp( '/"-1".*stock-unlimited/', $output ); |
|
| 76 | + $this->assertRegExp('/"-1".*stock-unlimited/', $output); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | public function testGetBodyException() |
| 81 | 81 | { |
| 82 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' ) |
|
| 83 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 84 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 82 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Stock\Standard') |
|
| 83 | + ->setConstructorArgs(array($this->context, array())) |
|
| 84 | + ->setMethods(array('setViewParams')) |
|
| 85 | 85 | ->getMock(); |
| 86 | 86 | |
| 87 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 88 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 87 | + $object->expects($this->once())->method('setViewParams') |
|
| 88 | + ->will($this->throwException(new \Exception())); |
|
| 89 | 89 | |
| 90 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 90 | + $object->setView(\TestHelperHtml::getView()); |
|
| 91 | 91 | |
| 92 | - $this->assertEquals( null, $object->getBody() ); |
|
| 92 | + $this->assertEquals(null, $object->getBody()); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | public function testGetSubClientInvalid() |
| 97 | 97 | { |
| 98 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 99 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 98 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 99 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | public function testGetSubClientInvalidName() |
| 104 | 104 | { |
| 105 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 106 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 105 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 106 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | protected function getProductItem() |
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context ); |
|
| 112 | + $manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context); |
|
| 113 | 113 | $search = $manager->createSearch(); |
| 114 | - $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) ); |
|
| 115 | - $items = $manager->searchItems( $search ); |
|
| 114 | + $search->setConditions($search->compare('==', 'product.code', 'CNC')); |
|
| 115 | + $items = $manager->searchItems($search); |
|
| 116 | 116 | |
| 117 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 118 | - throw new \Exception( 'No product item with code "CNC" found' ); |
|
| 117 | + if (($item = reset($items)) === false) { |
|
| 118 | + throw new \Exception('No product item with code "CNC" found'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $item; |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | $this->context = \TestHelperHtml::getContext(); |
| 26 | 26 | |
| 27 | 27 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 28 | - $this->object = new \Aimeos\Client\Html\Catalog\Session\Standard( $this->context, $paths ); |
|
| 29 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 28 | + $this->object = new \Aimeos\Client\Html\Catalog\Session\Standard($this->context, $paths); |
|
| 29 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -38,122 +38,122 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | protected function tearDown() |
| 40 | 40 | { |
| 41 | - unset( $this->object ); |
|
| 41 | + unset($this->object); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testGetHeader() |
| 46 | 46 | { |
| 47 | 47 | $output = $this->object->getHeader(); |
| 48 | - $this->assertNotNull( $output ); |
|
| 48 | + $this->assertNotNull($output); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testGetHeaderException() |
| 53 | 53 | { |
| 54 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' ) |
|
| 55 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 56 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 54 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Session\Standard') |
|
| 55 | + ->setConstructorArgs(array($this->context, array())) |
|
| 56 | + ->setMethods(array('setViewParams')) |
|
| 57 | 57 | ->getMock(); |
| 58 | 58 | |
| 59 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 60 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 59 | + $object->expects($this->once())->method('setViewParams') |
|
| 60 | + ->will($this->throwException(new \Exception())); |
|
| 61 | 61 | |
| 62 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 62 | + $object->setView(\TestHelperHtml::getView()); |
|
| 63 | 63 | |
| 64 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 64 | + $this->assertEquals(null, $object->getHeader()); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testGetBody() |
| 69 | 69 | { |
| 70 | 70 | $output = $this->object->getBody(); |
| 71 | - $this->assertStringStartsWith( '<section class="aimeos catalog-session">', $output ); |
|
| 71 | + $this->assertStringStartsWith('<section class="aimeos catalog-session">', $output); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | public function testGetBodyHtmlException() |
| 76 | 76 | { |
| 77 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' ) |
|
| 78 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 79 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 77 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Session\Standard') |
|
| 78 | + ->setConstructorArgs(array($this->context, array())) |
|
| 79 | + ->setMethods(array('setViewParams')) |
|
| 80 | 80 | ->getMock(); |
| 81 | 81 | |
| 82 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 83 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 82 | + $object->expects($this->once())->method('setViewParams') |
|
| 83 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 84 | 84 | |
| 85 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 85 | + $object->setView(\TestHelperHtml::getView()); |
|
| 86 | 86 | |
| 87 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 87 | + $this->assertContains('test exception', $object->getBody()); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | public function testGetBodyFrontendException() |
| 92 | 92 | { |
| 93 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' ) |
|
| 94 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 95 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 93 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Session\Standard') |
|
| 94 | + ->setConstructorArgs(array($this->context, array())) |
|
| 95 | + ->setMethods(array('setViewParams')) |
|
| 96 | 96 | ->getMock(); |
| 97 | 97 | |
| 98 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 99 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 98 | + $object->expects($this->once())->method('setViewParams') |
|
| 99 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 100 | 100 | |
| 101 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 101 | + $object->setView(\TestHelperHtml::getView()); |
|
| 102 | 102 | |
| 103 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 103 | + $this->assertContains('test exception', $object->getBody()); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | public function testGetBodyMShopException() |
| 108 | 108 | { |
| 109 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' ) |
|
| 110 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 111 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 109 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Session\Standard') |
|
| 110 | + ->setConstructorArgs(array($this->context, array())) |
|
| 111 | + ->setMethods(array('setViewParams')) |
|
| 112 | 112 | ->getMock(); |
| 113 | 113 | |
| 114 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 115 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 114 | + $object->expects($this->once())->method('setViewParams') |
|
| 115 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 116 | 116 | |
| 117 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 117 | + $object->setView(\TestHelperHtml::getView()); |
|
| 118 | 118 | |
| 119 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 119 | + $this->assertContains('test exception', $object->getBody()); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | public function testGetBodyException() |
| 124 | 124 | { |
| 125 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' ) |
|
| 126 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 127 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 125 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Session\Standard') |
|
| 126 | + ->setConstructorArgs(array($this->context, array())) |
|
| 127 | + ->setMethods(array('setViewParams')) |
|
| 128 | 128 | ->getMock(); |
| 129 | 129 | |
| 130 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 131 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 130 | + $object->expects($this->once())->method('setViewParams') |
|
| 131 | + ->will($this->throwException(new \Exception())); |
|
| 132 | 132 | |
| 133 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 133 | + $object->setView(\TestHelperHtml::getView()); |
|
| 134 | 134 | |
| 135 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 135 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | public function testGetSubClient() |
| 140 | 140 | { |
| 141 | - $client = $this->object->getSubClient( 'seen', 'Standard' ); |
|
| 142 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 141 | + $client = $this->object->getSubClient('seen', 'Standard'); |
|
| 142 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | public function testGetSubClientInvalid() |
| 147 | 147 | { |
| 148 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 149 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 148 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 149 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | public function testGetSubClientInvalidName() |
| 154 | 154 | { |
| 155 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 156 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 155 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 156 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
@@ -19,207 +19,207 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 21 | 21 | |
| 22 | - $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetHeader() |
| 34 | 34 | { |
| 35 | 35 | $view = $this->object->getView(); |
| 36 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) ); |
|
| 37 | - $view->addHelper( 'param', $helper ); |
|
| 36 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_catid' => $this->getCatalogItem()->getId())); |
|
| 37 | + $view->addHelper('param', $helper); |
|
| 38 | 38 | |
| 39 | 39 | $tags = array(); |
| 40 | 40 | $expire = null; |
| 41 | - $output = $this->object->getHeader( 1, $tags, $expire ); |
|
| 41 | + $output = $this->object->getHeader(1, $tags, $expire); |
|
| 42 | 42 | |
| 43 | - $this->assertStringStartsWith( ' <title>Kaffee</title>', $output ); |
|
| 44 | - $this->assertEquals( '2022-01-01 00:00:00', $expire ); |
|
| 45 | - $this->assertEquals( 4, count( $tags ) ); |
|
| 43 | + $this->assertStringStartsWith(' <title>Kaffee</title>', $output); |
|
| 44 | + $this->assertEquals('2022-01-01 00:00:00', $expire); |
|
| 45 | + $this->assertEquals(4, count($tags)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGetHeaderSearch() |
| 50 | 50 | { |
| 51 | 51 | $view = $this->object->getView(); |
| 52 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => '<b>Search result</b>' ) ); |
|
| 53 | - $view->addHelper( 'param', $helper ); |
|
| 52 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_search' => '<b>Search result</b>')); |
|
| 53 | + $view->addHelper('param', $helper); |
|
| 54 | 54 | |
| 55 | 55 | $tags = array(); |
| 56 | 56 | $expire = null; |
| 57 | - $output = $this->object->getHeader( 1, $tags, $expire ); |
|
| 57 | + $output = $this->object->getHeader(1, $tags, $expire); |
|
| 58 | 58 | |
| 59 | - $this->assertRegexp( '#<title>[^>]*Search result[^<]*</title>#', $output ); |
|
| 60 | - $this->assertEquals( null, $expire ); |
|
| 61 | - $this->assertEquals( 1, count( $tags ) ); |
|
| 59 | + $this->assertRegexp('#<title>[^>]*Search result[^<]*</title>#', $output); |
|
| 60 | + $this->assertEquals(null, $expire); |
|
| 61 | + $this->assertEquals(1, count($tags)); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | public function testGetBody() |
| 66 | 66 | { |
| 67 | 67 | $view = $this->object->getView(); |
| 68 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) ); |
|
| 69 | - $view->addHelper( 'param', $helper ); |
|
| 68 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_catid' => $this->getCatalogItem()->getId())); |
|
| 69 | + $view->addHelper('param', $helper); |
|
| 70 | 70 | |
| 71 | 71 | $tags = array(); |
| 72 | 72 | $expire = null; |
| 73 | - $output = $this->object->getBody( 1, $tags, $expire ); |
|
| 73 | + $output = $this->object->getBody(1, $tags, $expire); |
|
| 74 | 74 | |
| 75 | - $this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output ); |
|
| 76 | - $this->assertEquals( '2022-01-01 00:00:00', $expire ); |
|
| 77 | - $this->assertEquals( 4, count( $tags ) ); |
|
| 75 | + $this->assertStringStartsWith('<section class="aimeos catalog-list home categories coffee">', $output); |
|
| 76 | + $this->assertEquals('2022-01-01 00:00:00', $expire); |
|
| 77 | + $this->assertEquals(4, count($tags)); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | public function testGetBodyNoDefaultCat() |
| 82 | 82 | { |
| 83 | 83 | $view = $this->object->getView(); |
| 84 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() ); |
|
| 85 | - $view->addHelper( 'param', $helper ); |
|
| 84 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array()); |
|
| 85 | + $view->addHelper('param', $helper); |
|
| 86 | 86 | |
| 87 | 87 | $output = $this->object->getBody(); |
| 88 | - $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output ); |
|
| 89 | - $this->assertNotRegExp( '#.*U:TESTPSUB01.*#smu', $output ); |
|
| 90 | - $this->assertNotRegExp( '#.*U:TESTSUB03.*#smu', $output ); |
|
| 91 | - $this->assertNotRegExp( '#.*U:TESTSUB04.*#smu', $output ); |
|
| 92 | - $this->assertNotRegExp( '#.*U:TESTSUB05.*#smu', $output ); |
|
| 88 | + $this->assertStringStartsWith('<section class="aimeos catalog-list">', $output); |
|
| 89 | + $this->assertNotRegExp('#.*U:TESTPSUB01.*#smu', $output); |
|
| 90 | + $this->assertNotRegExp('#.*U:TESTSUB03.*#smu', $output); |
|
| 91 | + $this->assertNotRegExp('#.*U:TESTSUB04.*#smu', $output); |
|
| 92 | + $this->assertNotRegExp('#.*U:TESTSUB05.*#smu', $output); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | public function testGetBodyDefaultCat() |
| 97 | 97 | { |
| 98 | 98 | $context = clone $this->context; |
| 99 | - $context->getConfig()->set( 'client/html/catalog/lists/catid-default', $this->getCatalogItem()->getId() ); |
|
| 99 | + $context->getConfig()->set('client/html/catalog/lists/catid-default', $this->getCatalogItem()->getId()); |
|
| 100 | 100 | |
| 101 | 101 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 102 | - $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths ); |
|
| 103 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 102 | + $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard($context, $paths); |
|
| 103 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 104 | 104 | |
| 105 | 105 | $view = $this->object->getView(); |
| 106 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() ); |
|
| 107 | - $view->addHelper( 'param', $helper ); |
|
| 106 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array()); |
|
| 107 | + $view->addHelper('param', $helper); |
|
| 108 | 108 | |
| 109 | 109 | $output = $this->object->getBody(); |
| 110 | - $this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output ); |
|
| 110 | + $this->assertStringStartsWith('<section class="aimeos catalog-list home categories coffee">', $output); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | public function testGetBodyCategoryLevels() |
| 115 | 115 | { |
| 116 | 116 | $context = clone $this->context; |
| 117 | - $context->getConfig()->set( 'client/html/catalog/lists/levels', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ); |
|
| 117 | + $context->getConfig()->set('client/html/catalog/lists/levels', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE); |
|
| 118 | 118 | |
| 119 | 119 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 120 | - $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths ); |
|
| 121 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 120 | + $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard($context, $paths); |
|
| 121 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 122 | 122 | |
| 123 | 123 | $view = $this->object->getView(); |
| 124 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem( 'root' )->getId() ) ); |
|
| 125 | - $view->addHelper( 'param', $helper ); |
|
| 124 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_catid' => $this->getCatalogItem('root')->getId())); |
|
| 125 | + $view->addHelper('param', $helper); |
|
| 126 | 126 | |
| 127 | 127 | $output = $this->object->getBody(); |
| 128 | - $this->assertRegExp( '#.*Cafe Noire Cappuccino.*#smu', $output ); |
|
| 129 | - $this->assertRegExp( '#.*Cafe Noire Expresso.*#smu', $output ); |
|
| 130 | - $this->assertRegExp( '#.*Unittest: Bundle.*#smu', $output ); |
|
| 131 | - $this->assertRegExp( '#.*Unittest: Test priced Selection.*#smu', $output ); |
|
| 128 | + $this->assertRegExp('#.*Cafe Noire Cappuccino.*#smu', $output); |
|
| 129 | + $this->assertRegExp('#.*Cafe Noire Expresso.*#smu', $output); |
|
| 130 | + $this->assertRegExp('#.*Unittest: Bundle.*#smu', $output); |
|
| 131 | + $this->assertRegExp('#.*Unittest: Test priced Selection.*#smu', $output); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | public function testGetBodySearchText() |
| 136 | 136 | { |
| 137 | 137 | $view = $this->object->getView(); |
| 138 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Kaffee' ) ); |
|
| 139 | - $view->addHelper( 'param', $helper ); |
|
| 138 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_search' => 'Kaffee')); |
|
| 139 | + $view->addHelper('param', $helper); |
|
| 140 | 140 | |
| 141 | 141 | $output = $this->object->getBody(); |
| 142 | - $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output ); |
|
| 142 | + $this->assertStringStartsWith('<section class="aimeos catalog-list">', $output); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | public function testGetBodySearchAttribute() |
| 147 | 147 | { |
| 148 | 148 | $view = $this->object->getView(); |
| 149 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_attrid' => array( -1, -2 ) ) ); |
|
| 150 | - $view->addHelper( 'param', $helper ); |
|
| 149 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_attrid' => array( -1, -2 ))); |
|
| 150 | + $view->addHelper('param', $helper); |
|
| 151 | 151 | |
| 152 | 152 | $output = $this->object->getBody(); |
| 153 | - $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output ); |
|
| 153 | + $this->assertStringStartsWith('<section class="aimeos catalog-list">', $output); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | public function testGetBodyHtmlException() |
| 158 | 158 | { |
| 159 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' ) |
|
| 160 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 161 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 159 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Lists\Standard') |
|
| 160 | + ->setConstructorArgs(array($this->context, array())) |
|
| 161 | + ->setMethods(array('setViewParams')) |
|
| 162 | 162 | ->getMock(); |
| 163 | 163 | |
| 164 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 165 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 164 | + $object->expects($this->once())->method('setViewParams') |
|
| 165 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 166 | 166 | |
| 167 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 167 | + $object->setView(\TestHelperHtml::getView()); |
|
| 168 | 168 | |
| 169 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 169 | + $this->assertContains('test exception', $object->getBody()); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | public function testGetBodyFrontendException() |
| 174 | 174 | { |
| 175 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' ) |
|
| 176 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 177 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 175 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Lists\Standard') |
|
| 176 | + ->setConstructorArgs(array($this->context, array())) |
|
| 177 | + ->setMethods(array('setViewParams')) |
|
| 178 | 178 | ->getMock(); |
| 179 | 179 | |
| 180 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 181 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 180 | + $object->expects($this->once())->method('setViewParams') |
|
| 181 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 182 | 182 | |
| 183 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 183 | + $object->setView(\TestHelperHtml::getView()); |
|
| 184 | 184 | |
| 185 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 185 | + $this->assertContains('test exception', $object->getBody()); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| 189 | 189 | public function testGetBodyMShopException() |
| 190 | 190 | { |
| 191 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' ) |
|
| 192 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 193 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 191 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Lists\Standard') |
|
| 192 | + ->setConstructorArgs(array($this->context, array())) |
|
| 193 | + ->setMethods(array('setViewParams')) |
|
| 194 | 194 | ->getMock(); |
| 195 | 195 | |
| 196 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 196 | + $object->expects($this->once())->method('setViewParams') |
|
| 197 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 198 | 198 | |
| 199 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 199 | + $object->setView(\TestHelperHtml::getView()); |
|
| 200 | 200 | |
| 201 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 201 | + $this->assertContains('test exception', $object->getBody()); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | public function testGetSubClient() |
| 206 | 206 | { |
| 207 | - $client = $this->object->getSubClient( 'items', 'Standard' ); |
|
| 208 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 207 | + $client = $this->object->getSubClient('items', 'Standard'); |
|
| 208 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| 212 | 212 | public function testGetSubClientInvalid() |
| 213 | 213 | { |
| 214 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 215 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 214 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 215 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | public function testGetSubClientInvalidName() |
| 220 | 220 | { |
| 221 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 222 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 221 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 222 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
@@ -229,15 +229,15 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| 232 | - protected function getCatalogItem( $code = 'cafe' ) |
|
| 232 | + protected function getCatalogItem($code = 'cafe') |
|
| 233 | 233 | { |
| 234 | - $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
| 234 | + $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
| 235 | 235 | $search = $catalogManager->createSearch(); |
| 236 | - $search->setConditions( $search->compare( '==', 'catalog.code', $code ) ); |
|
| 237 | - $items = $catalogManager->searchItems( $search ); |
|
| 236 | + $search->setConditions($search->compare('==', 'catalog.code', $code)); |
|
| 237 | + $items = $catalogManager->searchItems($search); |
|
| 238 | 238 | |
| 239 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 240 | - throw new \Exception( sprintf( 'No catalog item with code "%1$s" found', $code ) ); |
|
| 239 | + if (($item = reset($items)) === false) { |
|
| 240 | + throw new \Exception(sprintf('No catalog item with code "%1$s" found', $code)); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return $item; |
@@ -19,79 +19,79 @@ |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetHeader() |
| 34 | 34 | { |
| 35 | 35 | $output = $this->object->getHeader(); |
| 36 | - $this->assertNotNull( $output ); |
|
| 36 | + $this->assertNotNull($output); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetHeaderException() |
| 41 | 41 | { |
| 42 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Suggest\Standard') |
|
| 43 | + ->setConstructorArgs(array($this->context, array())) |
|
| 44 | + ->setMethods(array('setViewParams')) |
|
| 45 | 45 | ->getMock(); |
| 46 | 46 | |
| 47 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 47 | + $object->expects($this->once())->method('setViewParams') |
|
| 48 | + ->will($this->throwException(new \Exception())); |
|
| 49 | 49 | |
| 50 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 50 | + $object->setView(\TestHelperHtml::getView()); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 52 | + $this->assertEquals(null, $object->getHeader()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public function testGetBody() |
| 57 | 57 | { |
| 58 | 58 | $view = $this->object->getView(); |
| 59 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) ); |
|
| 60 | - $view->addHelper( 'param', $helper ); |
|
| 59 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_search' => 'Unterpro')); |
|
| 60 | + $view->addHelper('param', $helper); |
|
| 61 | 61 | |
| 62 | 62 | $output = $this->object->getBody(); |
| 63 | 63 | |
| 64 | - $this->assertNotEquals( array(), $this->object->getView()->suggestTextItems ); |
|
| 65 | - $this->assertRegExp( '#"name":"Unterpro#smU', $output ); |
|
| 64 | + $this->assertNotEquals(array(), $this->object->getView()->suggestTextItems); |
|
| 65 | + $this->assertRegExp('#"name":"Unterpro#smU', $output); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | public function testGetBodyException() |
| 70 | 70 | { |
| 71 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 72 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 73 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 71 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Suggest\Standard') |
|
| 72 | + ->setConstructorArgs(array($this->context, array())) |
|
| 73 | + ->setMethods(array('setViewParams')) |
|
| 74 | 74 | ->getMock(); |
| 75 | 75 | |
| 76 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 77 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 76 | + $object->expects($this->once())->method('setViewParams') |
|
| 77 | + ->will($this->throwException(new \Exception())); |
|
| 78 | 78 | |
| 79 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 79 | + $object->setView(\TestHelperHtml::getView()); |
|
| 80 | 80 | |
| 81 | - $this->assertEquals( null, $object->getBody() ); |
|
| 81 | + $this->assertEquals(null, $object->getBody()); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | public function testGetSubClientInvalid() |
| 86 | 86 | { |
| 87 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 88 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 87 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 88 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | public function testGetSubClientInvalidName() |
| 93 | 93 | { |
| 94 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 95 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 94 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 95 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | \ No newline at end of file |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 20 | 20 | $this->context = \TestHelperHtml::getContext(); |
| 21 | 21 | |
| 22 | - $this->object = new \Aimeos\Client\Html\Catalog\Filter\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Catalog\Filter\Standard($this->context, $paths); |
|
| 23 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - unset( $this->object ); |
|
| 29 | + unset($this->object); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $tags = array(); |
| 36 | 36 | $expire = null; |
| 37 | - $output = $this->object->getHeader( 1, $tags, $expire ); |
|
| 37 | + $output = $this->object->getHeader(1, $tags, $expire); |
|
| 38 | 38 | |
| 39 | - $this->assertNotNull( $output ); |
|
| 40 | - $this->assertEquals( '2022-01-01 00:00:00', $expire ); |
|
| 41 | - $this->assertEquals( 5, count( $tags ) ); |
|
| 39 | + $this->assertNotNull($output); |
|
| 40 | + $this->assertEquals('2022-01-01 00:00:00', $expire); |
|
| 41 | + $this->assertEquals(5, count($tags)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
@@ -46,80 +46,80 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $tags = array(); |
| 48 | 48 | $expire = null; |
| 49 | - $output = $this->object->getBody( 1, $tags, $expire ); |
|
| 49 | + $output = $this->object->getBody(1, $tags, $expire); |
|
| 50 | 50 | |
| 51 | - $this->assertStringStartsWith( '<section class="aimeos catalog-filter">', $output ); |
|
| 52 | - $this->assertEquals( '2022-01-01 00:00:00', $expire ); |
|
| 53 | - $this->assertEquals( 5, count( $tags ) ); |
|
| 51 | + $this->assertStringStartsWith('<section class="aimeos catalog-filter">', $output); |
|
| 52 | + $this->assertEquals('2022-01-01 00:00:00', $expire); |
|
| 53 | + $this->assertEquals(5, count($tags)); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testGetBodyHtmlException() |
| 58 | 58 | { |
| 59 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Filter\Standard' ) |
|
| 60 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 61 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 59 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Filter\Standard') |
|
| 60 | + ->setConstructorArgs(array($this->context, array())) |
|
| 61 | + ->setMethods(array('setViewParams')) |
|
| 62 | 62 | ->getMock(); |
| 63 | 63 | |
| 64 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 65 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 64 | + $object->expects($this->once())->method('setViewParams') |
|
| 65 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 66 | 66 | |
| 67 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 67 | + $object->setView(\TestHelperHtml::getView()); |
|
| 68 | 68 | |
| 69 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 69 | + $this->assertContains('test exception', $object->getBody()); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | public function testGetBodyFrontendException() |
| 74 | 74 | { |
| 75 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Filter\Standard' ) |
|
| 76 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 77 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 75 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Filter\Standard') |
|
| 76 | + ->setConstructorArgs(array($this->context, array())) |
|
| 77 | + ->setMethods(array('setViewParams')) |
|
| 78 | 78 | ->getMock(); |
| 79 | 79 | |
| 80 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 81 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 80 | + $object->expects($this->once())->method('setViewParams') |
|
| 81 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 82 | 82 | |
| 83 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 83 | + $object->setView(\TestHelperHtml::getView()); |
|
| 84 | 84 | |
| 85 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 85 | + $this->assertContains('test exception', $object->getBody()); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function testGetBodyMShopException() |
| 90 | 90 | { |
| 91 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Filter\Standard' ) |
|
| 92 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 93 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 91 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Filter\Standard') |
|
| 92 | + ->setConstructorArgs(array($this->context, array())) |
|
| 93 | + ->setMethods(array('setViewParams')) |
|
| 94 | 94 | ->getMock(); |
| 95 | 95 | |
| 96 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 97 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 96 | + $object->expects($this->once())->method('setViewParams') |
|
| 97 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 98 | 98 | |
| 99 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 99 | + $object->setView(\TestHelperHtml::getView()); |
|
| 100 | 100 | |
| 101 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 101 | + $this->assertContains('test exception', $object->getBody()); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | public function testGetSubClient() |
| 106 | 106 | { |
| 107 | - $client = $this->object->getSubClient( 'tree', 'Standard' ); |
|
| 108 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 107 | + $client = $this->object->getSubClient('tree', 'Standard'); |
|
| 108 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | public function testGetSubClientInvalid() |
| 113 | 113 | { |
| 114 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 115 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 114 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 115 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | public function testGetSubClientInvalidName() |
| 120 | 120 | { |
| 121 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 122 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 121 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 122 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |