@@ -17,144 +17,144 @@ discard block |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | - $this->context->setEditor( 'UTC001' ); |
|
| 20 | + $this->context->setEditor('UTC001'); |
|
| 21 | 21 | |
| 22 | 22 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 23 | - $this->object = new \Aimeos\Client\Html\Checkout\Confirm\Standard( $this->context, $paths ); |
|
| 24 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 23 | + $this->object = new \Aimeos\Client\Html\Checkout\Confirm\Standard($this->context, $paths); |
|
| 24 | + $this->object->setView(\TestHelperHtml::getView()); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - unset( $this->object ); |
|
| 30 | + unset($this->object); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | public function testGetHeader() |
| 35 | 35 | { |
| 36 | - $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() ); |
|
| 36 | + $this->context->getSession()->set('aimeos/orderid', $this->getOrder('2011-09-17 16:14:32')->getId()); |
|
| 37 | 37 | |
| 38 | 38 | $output = $this->object->getHeader(); |
| 39 | - $this->assertNotNull( $output ); |
|
| 39 | + $this->assertNotNull($output); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | public function testGetHeaderException() |
| 44 | 44 | { |
| 45 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' ) |
|
| 46 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 47 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 45 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Confirm\Standard') |
|
| 46 | + ->setConstructorArgs(array($this->context, array())) |
|
| 47 | + ->setMethods(array('setViewParams')) |
|
| 48 | 48 | ->getMock(); |
| 49 | 49 | |
| 50 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 51 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 50 | + $object->expects($this->once())->method('setViewParams') |
|
| 51 | + ->will($this->throwException(new \Exception())); |
|
| 52 | 52 | |
| 53 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 53 | + $object->setView(\TestHelperHtml::getView()); |
|
| 54 | 54 | |
| 55 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 55 | + $this->assertEquals(null, $object->getHeader()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | public function testGetBody() |
| 60 | 60 | { |
| 61 | - $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() ); |
|
| 61 | + $this->context->getSession()->set('aimeos/orderid', $this->getOrder('2011-09-17 16:14:32')->getId()); |
|
| 62 | 62 | |
| 63 | 63 | $output = $this->object->getBody(); |
| 64 | - $this->assertStringStartsWith( '<section class="aimeos checkout-confirm">', $output ); |
|
| 64 | + $this->assertStringStartsWith('<section class="aimeos checkout-confirm">', $output); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | public function testGetBodyHtmlException() |
| 69 | 69 | { |
| 70 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' ) |
|
| 71 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 72 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 70 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Confirm\Standard') |
|
| 71 | + ->setConstructorArgs(array($this->context, array())) |
|
| 72 | + ->setMethods(array('setViewParams')) |
|
| 73 | 73 | ->getMock(); |
| 74 | 74 | |
| 75 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 76 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 75 | + $object->expects($this->once())->method('setViewParams') |
|
| 76 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 77 | 77 | |
| 78 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 78 | + $object->setView(\TestHelperHtml::getView()); |
|
| 79 | 79 | |
| 80 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 80 | + $this->assertContains('test exception', $object->getBody()); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | public function testGetBodyFrontendException() |
| 85 | 85 | { |
| 86 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' ) |
|
| 87 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 88 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 86 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Confirm\Standard') |
|
| 87 | + ->setConstructorArgs(array($this->context, array())) |
|
| 88 | + ->setMethods(array('setViewParams')) |
|
| 89 | 89 | ->getMock(); |
| 90 | 90 | |
| 91 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 92 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 91 | + $object->expects($this->once())->method('setViewParams') |
|
| 92 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 93 | 93 | |
| 94 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 94 | + $object->setView(\TestHelperHtml::getView()); |
|
| 95 | 95 | |
| 96 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 96 | + $this->assertContains('test exception', $object->getBody()); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | public function testGetBodyMShopException() |
| 101 | 101 | { |
| 102 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' ) |
|
| 103 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 104 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 102 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Confirm\Standard') |
|
| 103 | + ->setConstructorArgs(array($this->context, array())) |
|
| 104 | + ->setMethods(array('setViewParams')) |
|
| 105 | 105 | ->getMock(); |
| 106 | 106 | |
| 107 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 108 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 107 | + $object->expects($this->once())->method('setViewParams') |
|
| 108 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 109 | 109 | |
| 110 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 110 | + $object->setView(\TestHelperHtml::getView()); |
|
| 111 | 111 | |
| 112 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 112 | + $this->assertContains('test exception', $object->getBody()); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | public function testGetBodyException() |
| 117 | 117 | { |
| 118 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' ) |
|
| 119 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 120 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 118 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Confirm\Standard') |
|
| 119 | + ->setConstructorArgs(array($this->context, array())) |
|
| 120 | + ->setMethods(array('setViewParams')) |
|
| 121 | 121 | ->getMock(); |
| 122 | 122 | |
| 123 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 124 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 123 | + $object->expects($this->once())->method('setViewParams') |
|
| 124 | + ->will($this->throwException(new \Exception())); |
|
| 125 | 125 | |
| 126 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 126 | + $object->setView(\TestHelperHtml::getView()); |
|
| 127 | 127 | |
| 128 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 128 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | public function testGetSubClientInvalid() |
| 133 | 133 | { |
| 134 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 135 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 134 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 135 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | public function testGetSubClientInvalidName() |
| 140 | 140 | { |
| 141 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 142 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 141 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 142 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | 146 | public function testProcess() |
| 147 | 147 | { |
| 148 | - $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() ); |
|
| 148 | + $this->context->getSession()->set('aimeos/orderid', $this->getOrder('2011-09-17 16:14:32')->getId()); |
|
| 149 | 149 | |
| 150 | 150 | $view = $this->object->getView(); |
| 151 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'code' => 'paypalexpress' ) ); |
|
| 152 | - $view->addHelper( 'param', $helper ); |
|
| 151 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('code' => 'paypalexpress')); |
|
| 152 | + $view->addHelper('param', $helper); |
|
| 153 | 153 | |
| 154 | 154 | $view = $this->object->getView(); |
| 155 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
| 156 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' ); |
|
| 157 | - $view->addHelper( 'request', $helper ); |
|
| 155 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
| 156 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, $request, '127.0.0.1', 'test'); |
|
| 157 | + $view->addHelper('request', $helper); |
|
| 158 | 158 | |
| 159 | 159 | $this->object->process(); |
| 160 | 160 | } |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | /** |
| 170 | 170 | * @param string $date |
| 171 | 171 | */ |
| 172 | - protected function getOrder( $date ) |
|
| 172 | + protected function getOrder($date) |
|
| 173 | 173 | { |
| 174 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context ); |
|
| 174 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($this->context); |
|
| 175 | 175 | |
| 176 | 176 | $search = $orderManager->createSearch(); |
| 177 | - $search->setConditions( $search->compare( '==', 'order.datepayment', $date ) ); |
|
| 177 | + $search->setConditions($search->compare('==', 'order.datepayment', $date)); |
|
| 178 | 178 | |
| 179 | - $result = $orderManager->searchItems( $search ); |
|
| 179 | + $result = $orderManager->searchItems($search); |
|
| 180 | 180 | |
| 181 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 182 | - throw new \Exception( 'No order found' ); |
|
| 181 | + if (($item = reset($result)) === false) { |
|
| 182 | + throw new \Exception('No order found'); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | 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\Checkout\Standard\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Checkout\Standard\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\Checkout\Standard\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Standard\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,18 +58,18 @@ discard block |
||
| 58 | 58 | $view = $this->object->getView(); |
| 59 | 59 | $view->standardStepActive = 'address'; |
| 60 | 60 | |
| 61 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'c_step' => 'payment' ) ); |
|
| 62 | - $view->addHelper( 'param', $helper ); |
|
| 61 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('c_step' => 'payment')); |
|
| 62 | + $view->addHelper('param', $helper); |
|
| 63 | 63 | |
| 64 | 64 | $output = $this->object->getBody(); |
| 65 | 65 | |
| 66 | - $this->assertStringStartsWith( '<section class="aimeos checkout-standard">', $output ); |
|
| 67 | - $this->assertRegExp( '#<ol class="steps">.*<li class="step.*>.*</li>.*</ol>#smU', $output ); |
|
| 68 | - $this->assertContains( '<section class="checkout-standard-address', $output ); |
|
| 69 | - $this->assertNotContains( '<section class="checkout-standard-delivery', $output ); |
|
| 70 | - $this->assertNotContains( '<section class="checkout-standard-payment', $output ); |
|
| 71 | - $this->assertNotContains( '<section class="checkout-standard-summary', $output ); |
|
| 72 | - $this->assertNotContains( '<section class="checkout-standard-order', $output ); |
|
| 66 | + $this->assertStringStartsWith('<section class="aimeos checkout-standard">', $output); |
|
| 67 | + $this->assertRegExp('#<ol class="steps">.*<li class="step.*>.*</li>.*</ol>#smU', $output); |
|
| 68 | + $this->assertContains('<section class="checkout-standard-address', $output); |
|
| 69 | + $this->assertNotContains('<section class="checkout-standard-delivery', $output); |
|
| 70 | + $this->assertNotContains('<section class="checkout-standard-payment', $output); |
|
| 71 | + $this->assertNotContains('<section class="checkout-standard-summary', $output); |
|
| 72 | + $this->assertNotContains('<section class="checkout-standard-order', $output); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -78,18 +78,18 @@ discard block |
||
| 78 | 78 | $view = $this->object->getView(); |
| 79 | 79 | |
| 80 | 80 | $config = $this->context->getConfig(); |
| 81 | - $config->set( 'client/html/checkout/standard/onepage', array( 'address', 'delivery', 'payment', 'summary' ) ); |
|
| 81 | + $config->set('client/html/checkout/standard/onepage', array('address', 'delivery', 'payment', 'summary')); |
|
| 82 | 82 | |
| 83 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 84 | - $view->addHelper( 'config', $helper ); |
|
| 83 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 84 | + $view->addHelper('config', $helper); |
|
| 85 | 85 | |
| 86 | 86 | $output = $this->object->getBody(); |
| 87 | 87 | |
| 88 | - $this->assertContains( '<section class="checkout-standard-address', $output ); |
|
| 89 | - $this->assertContains( '<section class="checkout-standard-delivery', $output ); |
|
| 90 | - $this->assertContains( '<section class="checkout-standard-payment', $output ); |
|
| 91 | - $this->assertContains( '<section class="checkout-standard-summary', $output ); |
|
| 92 | - $this->assertNotContains( '<section class="checkout-standard-order', $output ); |
|
| 88 | + $this->assertContains('<section class="checkout-standard-address', $output); |
|
| 89 | + $this->assertContains('<section class="checkout-standard-delivery', $output); |
|
| 90 | + $this->assertContains('<section class="checkout-standard-payment', $output); |
|
| 91 | + $this->assertContains('<section class="checkout-standard-summary', $output); |
|
| 92 | + $this->assertNotContains('<section class="checkout-standard-order', $output); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
@@ -99,18 +99,18 @@ discard block |
||
| 99 | 99 | $view->standardStepActive = 'delivery'; |
| 100 | 100 | |
| 101 | 101 | $config = $this->context->getConfig(); |
| 102 | - $config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) ); |
|
| 102 | + $config->set('client/html/checkout/standard/onepage', array('delivery', 'payment')); |
|
| 103 | 103 | |
| 104 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 105 | - $view->addHelper( 'config', $helper ); |
|
| 104 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 105 | + $view->addHelper('config', $helper); |
|
| 106 | 106 | |
| 107 | 107 | $output = $this->object->getBody(); |
| 108 | 108 | |
| 109 | - $this->assertContains( '<section class="checkout-standard-delivery', $output ); |
|
| 110 | - $this->assertContains( '<section class="checkout-standard-payment', $output ); |
|
| 111 | - $this->assertNotContains( '<section class="checkout-standard-address', $output ); |
|
| 112 | - $this->assertNotContains( '<section class="checkout-standard-summary', $output ); |
|
| 113 | - $this->assertNotContains( '<section class="checkout-standard-order', $output ); |
|
| 109 | + $this->assertContains('<section class="checkout-standard-delivery', $output); |
|
| 110 | + $this->assertContains('<section class="checkout-standard-payment', $output); |
|
| 111 | + $this->assertNotContains('<section class="checkout-standard-address', $output); |
|
| 112 | + $this->assertNotContains('<section class="checkout-standard-summary', $output); |
|
| 113 | + $this->assertNotContains('<section class="checkout-standard-order', $output); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -120,103 +120,103 @@ discard block |
||
| 120 | 120 | $view->standardStepActive = 'address'; |
| 121 | 121 | |
| 122 | 122 | $config = $this->context->getConfig(); |
| 123 | - $config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) ); |
|
| 123 | + $config->set('client/html/checkout/standard/onepage', array('delivery', 'payment')); |
|
| 124 | 124 | |
| 125 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 126 | - $view->addHelper( 'config', $helper ); |
|
| 125 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 126 | + $view->addHelper('config', $helper); |
|
| 127 | 127 | |
| 128 | 128 | $output = $this->object->getBody(); |
| 129 | 129 | |
| 130 | - $this->assertContains( '<section class="checkout-standard-address', $output ); |
|
| 131 | - $this->assertNotContains( '<section class="checkout-standard-delivery', $output ); |
|
| 132 | - $this->assertNotContains( '<section class="checkout-standard-payment', $output ); |
|
| 133 | - $this->assertNotContains( '<section class="checkout-standard-summary', $output ); |
|
| 134 | - $this->assertNotContains( '<section class="checkout-standard-order', $output ); |
|
| 130 | + $this->assertContains('<section class="checkout-standard-address', $output); |
|
| 131 | + $this->assertNotContains('<section class="checkout-standard-delivery', $output); |
|
| 132 | + $this->assertNotContains('<section class="checkout-standard-payment', $output); |
|
| 133 | + $this->assertNotContains('<section class="checkout-standard-summary', $output); |
|
| 134 | + $this->assertNotContains('<section class="checkout-standard-order', $output); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| 138 | 138 | public function testGetBodyHtmlException() |
| 139 | 139 | { |
| 140 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' ) |
|
| 141 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 142 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 140 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Standard\Standard') |
|
| 141 | + ->setConstructorArgs(array($this->context, array())) |
|
| 142 | + ->setMethods(array('setViewParams')) |
|
| 143 | 143 | ->getMock(); |
| 144 | 144 | |
| 145 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 146 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 145 | + $object->expects($this->once())->method('setViewParams') |
|
| 146 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 147 | 147 | |
| 148 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 148 | + $object->setView(\TestHelperHtml::getView()); |
|
| 149 | 149 | |
| 150 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 150 | + $this->assertContains('test exception', $object->getBody()); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | public function testGetBodyFrontendException() |
| 155 | 155 | { |
| 156 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' ) |
|
| 157 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 158 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 156 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Standard\Standard') |
|
| 157 | + ->setConstructorArgs(array($this->context, array())) |
|
| 158 | + ->setMethods(array('setViewParams')) |
|
| 159 | 159 | ->getMock(); |
| 160 | 160 | |
| 161 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 162 | - ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 161 | + $object->expects($this->once())->method('setViewParams') |
|
| 162 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 163 | 163 | |
| 164 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 164 | + $object->setView(\TestHelperHtml::getView()); |
|
| 165 | 165 | |
| 166 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 166 | + $this->assertContains('test exception', $object->getBody()); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | public function testGetBodyMShopException() |
| 171 | 171 | { |
| 172 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' ) |
|
| 173 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 174 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 172 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Standard\Standard') |
|
| 173 | + ->setConstructorArgs(array($this->context, array())) |
|
| 174 | + ->setMethods(array('setViewParams')) |
|
| 175 | 175 | ->getMock(); |
| 176 | 176 | |
| 177 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 178 | - ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) ); |
|
| 177 | + $object->expects($this->once())->method('setViewParams') |
|
| 178 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 179 | 179 | |
| 180 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 180 | + $object->setView(\TestHelperHtml::getView()); |
|
| 181 | 181 | |
| 182 | - $this->assertContains( 'test exception', $object->getBody() ); |
|
| 182 | + $this->assertContains('test exception', $object->getBody()); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | public function testGetBodyException() |
| 187 | 187 | { |
| 188 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' ) |
|
| 189 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 190 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 188 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Standard\Standard') |
|
| 189 | + ->setConstructorArgs(array($this->context, array())) |
|
| 190 | + ->setMethods(array('setViewParams')) |
|
| 191 | 191 | ->getMock(); |
| 192 | 192 | |
| 193 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 194 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 193 | + $object->expects($this->once())->method('setViewParams') |
|
| 194 | + ->will($this->throwException(new \Exception())); |
|
| 195 | 195 | |
| 196 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 196 | + $object->setView(\TestHelperHtml::getView()); |
|
| 197 | 197 | |
| 198 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 198 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | public function testGetSubClient() |
| 203 | 203 | { |
| 204 | - $client = $this->object->getSubClient( 'address', 'Standard' ); |
|
| 205 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 204 | + $client = $this->object->getSubClient('address', 'Standard'); |
|
| 205 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | public function testGetSubClientInvalid() |
| 210 | 210 | { |
| 211 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 212 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 211 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 212 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
| 216 | 216 | public function testGetSubClientInvalidName() |
| 217 | 217 | { |
| 218 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 219 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 218 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 219 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
@@ -19,57 +19,57 @@ discard block |
||
| 19 | 19 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 20 | 20 | $this->context = \TestHelperHtml::getContext(); |
| 21 | 21 | |
| 22 | - $this->object = new \Aimeos\Client\Html\Checkout\Update\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Checkout\Update\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\Checkout\Update\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Update\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 | - $this->assertEquals( '', $this->object->getBody() ); |
|
| 58 | + $this->assertEquals('', $this->object->getBody()); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | public function testGetBodyHtmlException() |
| 63 | 63 | { |
| 64 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' ) |
|
| 65 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 66 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 64 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Update\Standard') |
|
| 65 | + ->setConstructorArgs(array($this->context, array())) |
|
| 66 | + ->setMethods(array('setViewParams')) |
|
| 67 | 67 | ->getMock(); |
| 68 | 68 | |
| 69 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 70 | - ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) ); |
|
| 69 | + $object->expects($this->once())->method('setViewParams') |
|
| 70 | + ->will($this->throwException(new \Aimeos\Client\Html\Exception('test exception'))); |
|
| 71 | 71 | |
| 72 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 72 | + $object->setView(\TestHelperHtml::getView()); |
|
| 73 | 73 | |
| 74 | 74 | $object->getBody(); |
| 75 | 75 | } |
@@ -77,15 +77,15 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function testGetBodyFrontendException() |
| 79 | 79 | { |
| 80 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' ) |
|
| 81 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 82 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 80 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Update\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\Controller\Frontend\Exception( 'test exception' ) ) ); |
|
| 85 | + $object->expects($this->once())->method('setViewParams') |
|
| 86 | + ->will($this->throwException(new \Aimeos\Controller\Frontend\Exception('test exception'))); |
|
| 87 | 87 | |
| 88 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 88 | + $object->setView(\TestHelperHtml::getView()); |
|
| 89 | 89 | |
| 90 | 90 | $object->getBody(); |
| 91 | 91 | } |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function testGetBodyMShopException() |
| 95 | 95 | { |
| 96 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' ) |
|
| 97 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 98 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 96 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Update\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\MShop\Exception( 'test exception' ) ) ); |
|
| 101 | + $object->expects($this->once())->method('setViewParams') |
|
| 102 | + ->will($this->throwException(new \Aimeos\MShop\Exception('test exception'))); |
|
| 103 | 103 | |
| 104 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 104 | + $object->setView(\TestHelperHtml::getView()); |
|
| 105 | 105 | |
| 106 | 106 | $object->getBody(); |
| 107 | 107 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function testGetBodyException() |
| 111 | 111 | { |
| 112 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' ) |
|
| 113 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 114 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 112 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Checkout\Update\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 \Exception() ) ); |
|
| 117 | + $object->expects($this->once())->method('setViewParams') |
|
| 118 | + ->will($this->throwException(new \Exception())); |
|
| 119 | 119 | |
| 120 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 120 | + $object->setView(\TestHelperHtml::getView()); |
|
| 121 | 121 | |
| 122 | 122 | $object->getBody(); |
| 123 | 123 | } |
@@ -125,15 +125,15 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function testGetSubClientInvalid() |
| 127 | 127 | { |
| 128 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 129 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 128 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 129 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | public function testGetSubClientInvalidName() |
| 134 | 134 | { |
| 135 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 136 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 135 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 136 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
@@ -141,16 +141,16 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $params = array( |
| 143 | 143 | 'code' => 'paypalexpress', |
| 144 | - 'orderid' => $this->getOrder( '2011-09-17 16:14:32' )->getId(), |
|
| 144 | + 'orderid' => $this->getOrder('2011-09-17 16:14:32')->getId(), |
|
| 145 | 145 | ); |
| 146 | 146 | |
| 147 | 147 | $view = $this->object->getView(); |
| 148 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); |
|
| 149 | - $view->addHelper( 'param', $helper ); |
|
| 148 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); |
|
| 149 | + $view->addHelper('param', $helper); |
|
| 150 | 150 | |
| 151 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
| 152 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' ); |
|
| 153 | - $view->addHelper( 'request', $helper ); |
|
| 151 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
| 152 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, $request, '127.0.0.1', 'test'); |
|
| 153 | + $view->addHelper('request', $helper); |
|
| 154 | 154 | |
| 155 | 155 | $this->object->process(); |
| 156 | 156 | } |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $view = $this->object->getView(); |
| 162 | 162 | |
| 163 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
| 164 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' ); |
|
| 165 | - $view->addHelper( 'request', $helper ); |
|
| 163 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
| 164 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, $request, '127.0.0.1', 'test'); |
|
| 165 | + $view->addHelper('request', $helper); |
|
| 166 | 166 | |
| 167 | 167 | $this->object->process(); |
| 168 | 168 | } |
@@ -171,17 +171,17 @@ discard block |
||
| 171 | 171 | /** |
| 172 | 172 | * @param string $date |
| 173 | 173 | */ |
| 174 | - protected function getOrder( $date ) |
|
| 174 | + protected function getOrder($date) |
|
| 175 | 175 | { |
| 176 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context ); |
|
| 176 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($this->context); |
|
| 177 | 177 | |
| 178 | 178 | $search = $orderManager->createSearch(); |
| 179 | - $search->setConditions( $search->compare( '==', 'order.datepayment', $date ) ); |
|
| 179 | + $search->setConditions($search->compare('==', 'order.datepayment', $date)); |
|
| 180 | 180 | |
| 181 | - $result = $orderManager->searchItems( $search ); |
|
| 181 | + $result = $orderManager->searchItems($search); |
|
| 182 | 182 | |
| 183 | - if( ( $item = reset( $result ) ) === false ) { |
|
| 184 | - throw new \Exception( 'No order found' ); |
|
| 183 | + if (($item = reset($result)) === false) { |
|
| 184 | + throw new \Exception('No order found'); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | return $item; |
@@ -19,122 +19,122 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Account\Favorite\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Account\Favorite\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\Account\Favorite\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Favorite\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 account-favorite">', $output ); |
|
| 59 | + $this->assertStringStartsWith('<section class="aimeos account-favorite">', $output); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | public function testGetBodyHtmlException() |
| 64 | 64 | { |
| 65 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Favorite\Standard' ) |
|
| 66 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 67 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 65 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Favorite\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\Account\Favorite\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 83 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 81 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Favorite\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\Account\Favorite\Standard' ) |
|
| 98 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 99 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 97 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Favorite\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 testGetBodyException() |
| 112 | 112 | { |
| 113 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Favorite\Standard' ) |
|
| 114 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 115 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 113 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Favorite\Standard') |
|
| 114 | + ->setConstructorArgs(array($this->context, array())) |
|
| 115 | + ->setMethods(array('setViewParams')) |
|
| 116 | 116 | ->getMock(); |
| 117 | 117 | |
| 118 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 119 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 118 | + $object->expects($this->once())->method('setViewParams') |
|
| 119 | + ->will($this->throwException(new \Exception())); |
|
| 120 | 120 | |
| 121 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 121 | + $object->setView(\TestHelperHtml::getView()); |
|
| 122 | 122 | |
| 123 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 123 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetSubClientInvalid() |
| 128 | 128 | { |
| 129 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 130 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 129 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 130 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function testGetSubClientInvalidName() |
| 135 | 135 | { |
| 136 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 137 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 136 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 137 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | public function testProcessAddItem() |
| 148 | 148 | { |
| 149 | - $this->context->setUserId( '123' ); |
|
| 149 | + $this->context->setUserId('123'); |
|
| 150 | 150 | |
| 151 | 151 | $view = $this->object->getView(); |
| 152 | 152 | $param = array( |
@@ -154,32 +154,32 @@ discard block |
||
| 154 | 154 | 'fav_id' => 321, |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 158 | - $view->addHelper( 'param', $helper ); |
|
| 157 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 158 | + $view->addHelper('param', $helper); |
|
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | |
| 162 | - $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' ) |
|
| 163 | - ->setMethods( array( 'saveItem', 'moveItem' ) ) |
|
| 164 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 162 | + $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard') |
|
| 163 | + ->setMethods(array('saveItem', 'moveItem')) |
|
| 164 | + ->setConstructorArgs(array($this->context)) |
|
| 165 | 165 | ->getMock(); |
| 166 | 166 | |
| 167 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 168 | - ->setMethods( array( 'getSubManager' ) ) |
|
| 169 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 167 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 168 | + ->setMethods(array('getSubManager')) |
|
| 169 | + ->setConstructorArgs(array($this->context)) |
|
| 170 | 170 | ->getMock(); |
| 171 | 171 | |
| 172 | 172 | $name = 'ClientHtmlAccountFavoriteDefaultProcess'; |
| 173 | - $this->context->getConfig()->set( 'mshop/customer/manager/name', $name ); |
|
| 173 | + $this->context->getConfig()->set('mshop/customer/manager/name', $name); |
|
| 174 | 174 | |
| 175 | - \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub ); |
|
| 175 | + \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\'.$name, $managerStub); |
|
| 176 | 176 | |
| 177 | 177 | |
| 178 | - $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' ) |
|
| 179 | - ->will( $this->returnValue( $listManagerStub ) ); |
|
| 178 | + $managerStub->expects($this->atLeastOnce())->method('getSubManager') |
|
| 179 | + ->will($this->returnValue($listManagerStub)); |
|
| 180 | 180 | |
| 181 | - $listManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 182 | - $listManagerStub->expects( $this->once() )->method( 'moveItem' ); |
|
| 181 | + $listManagerStub->expects($this->once())->method('saveItem'); |
|
| 182 | + $listManagerStub->expects($this->once())->method('moveItem'); |
|
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | $this->object->process(); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | public function testProcessDeleteItem() |
| 190 | 190 | { |
| 191 | - $this->context->setUserId( '123' ); |
|
| 191 | + $this->context->setUserId('123'); |
|
| 192 | 192 | |
| 193 | 193 | $view = $this->object->getView(); |
| 194 | 194 | $param = array( |
@@ -196,31 +196,31 @@ discard block |
||
| 196 | 196 | 'fav_id' => 321, |
| 197 | 197 | ); |
| 198 | 198 | |
| 199 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 200 | - $view->addHelper( 'param', $helper ); |
|
| 199 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 200 | + $view->addHelper('param', $helper); |
|
| 201 | 201 | |
| 202 | 202 | |
| 203 | 203 | |
| 204 | - $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' ) |
|
| 205 | - ->setMethods( array( 'deleteItems' ) ) |
|
| 206 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 204 | + $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard') |
|
| 205 | + ->setMethods(array('deleteItems')) |
|
| 206 | + ->setConstructorArgs(array($this->context)) |
|
| 207 | 207 | ->getMock(); |
| 208 | 208 | |
| 209 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 210 | - ->setMethods( array( 'getSubManager' ) ) |
|
| 211 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 209 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 210 | + ->setMethods(array('getSubManager')) |
|
| 211 | + ->setConstructorArgs(array($this->context)) |
|
| 212 | 212 | ->getMock(); |
| 213 | 213 | |
| 214 | 214 | $name = 'ClientHtmlAccountFavoriteDefaultProcess'; |
| 215 | - $this->context->getConfig()->set( 'mshop/customer/manager/name', $name ); |
|
| 215 | + $this->context->getConfig()->set('mshop/customer/manager/name', $name); |
|
| 216 | 216 | |
| 217 | - \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub ); |
|
| 217 | + \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\'.$name, $managerStub); |
|
| 218 | 218 | |
| 219 | 219 | |
| 220 | - $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' ) |
|
| 221 | - ->will( $this->returnValue( $listManagerStub ) ); |
|
| 220 | + $managerStub->expects($this->atLeastOnce())->method('getSubManager') |
|
| 221 | + ->will($this->returnValue($listManagerStub)); |
|
| 222 | 222 | |
| 223 | - $listManagerStub->expects( $this->once() )->method( 'deleteItems' ); |
|
| 223 | + $listManagerStub->expects($this->once())->method('deleteItems'); |
|
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | $this->object->process(); |
@@ -19,129 +19,129 @@ |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Account\History\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Account\History\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\Account\History\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\History\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 account-history">', $output ); |
|
| 59 | + $this->assertStringStartsWith('<section class="aimeos account-history">', $output); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | public function testGetBodyHtmlException() |
| 64 | 64 | { |
| 65 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\History\Standard' ) |
|
| 66 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 67 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 65 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\History\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\Account\History\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 83 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 81 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\History\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\Account\History\Standard' ) |
|
| 98 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 99 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 97 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\History\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 testGetBodyException() |
| 112 | 112 | { |
| 113 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\History\Standard' ) |
|
| 114 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 115 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 113 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\History\Standard') |
|
| 114 | + ->setConstructorArgs(array($this->context, array())) |
|
| 115 | + ->setMethods(array('setViewParams')) |
|
| 116 | 116 | ->getMock(); |
| 117 | 117 | |
| 118 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 119 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 118 | + $object->expects($this->once())->method('setViewParams') |
|
| 119 | + ->will($this->throwException(new \Exception())); |
|
| 120 | 120 | |
| 121 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 121 | + $object->setView(\TestHelperHtml::getView()); |
|
| 122 | 122 | |
| 123 | - $this->assertContains( 'A non-recoverable error occured', $object->getBody() ); |
|
| 123 | + $this->assertContains('A non-recoverable error occured', $object->getBody()); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetSubClient() |
| 128 | 128 | { |
| 129 | - $client = $this->object->getSubClient( 'lists', 'Standard' ); |
|
| 130 | - $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client ); |
|
| 129 | + $client = $this->object->getSubClient('lists', 'Standard'); |
|
| 130 | + $this->assertInstanceOf('\\Aimeos\\Client\\HTML\\Iface', $client); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function testGetSubClientInvalid() |
| 135 | 135 | { |
| 136 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 137 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 136 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 137 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | public function testGetSubClientInvalidName() |
| 142 | 142 | { |
| 143 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 144 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 143 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 144 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
@@ -19,106 +19,106 @@ discard block |
||
| 19 | 19 | $this->context = \TestHelperHtml::getContext(); |
| 20 | 20 | |
| 21 | 21 | $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
| 22 | - $this->object = new \Aimeos\Client\Html\Account\Watch\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Account\Watch\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\Account\Watch\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 42 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Watch\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 account-watch">', $output ); |
|
| 59 | + $this->assertStringStartsWith('<section class="aimeos account-watch">', $output); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | public function testGetBodyHtmlException() |
| 64 | 64 | { |
| 65 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Watch\Standard' ) |
|
| 66 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 67 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 65 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Watch\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\Account\Watch\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 83 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 81 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Watch\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\Account\Watch\Standard' ) |
|
| 98 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 99 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 97 | + $object = $this->getMockBuilder('\Aimeos\Client\Html\Account\Watch\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 testGetSubClientInvalid() |
| 112 | 112 | { |
| 113 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 114 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 113 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 114 | + $this->object->getSubClient('invalid', 'invalid'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | public function testGetSubClientInvalidName() |
| 119 | 119 | { |
| 120 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 121 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 120 | + $this->setExpectedException('\\Aimeos\\Client\\Html\\Exception'); |
|
| 121 | + $this->object->getSubClient('$$$', '$$$'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | public function testProcessAddItem() |
| 132 | 132 | { |
| 133 | - $this->context->setUserId( '123' ); |
|
| 133 | + $this->context->setUserId('123'); |
|
| 134 | 134 | |
| 135 | 135 | $view = $this->object->getView(); |
| 136 | 136 | $param = array( |
@@ -138,32 +138,32 @@ discard block |
||
| 138 | 138 | 'wat_id' => 321, |
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 142 | - $view->addHelper( 'param', $helper ); |
|
| 141 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 142 | + $view->addHelper('param', $helper); |
|
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | |
| 146 | - $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' ) |
|
| 147 | - ->setMethods( array( 'saveItem', 'moveItem' ) ) |
|
| 148 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 146 | + $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard') |
|
| 147 | + ->setMethods(array('saveItem', 'moveItem')) |
|
| 148 | + ->setConstructorArgs(array($this->context)) |
|
| 149 | 149 | ->getMock(); |
| 150 | 150 | |
| 151 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 152 | - ->setMethods( array( 'getSubManager' ) ) |
|
| 153 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 151 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 152 | + ->setMethods(array('getSubManager')) |
|
| 153 | + ->setConstructorArgs(array($this->context)) |
|
| 154 | 154 | ->getMock(); |
| 155 | 155 | |
| 156 | 156 | $name = 'ClientHtmlAccountWatchDefaultProcess'; |
| 157 | - $this->context->getConfig()->set( 'mshop/customer/manager/name', $name ); |
|
| 157 | + $this->context->getConfig()->set('mshop/customer/manager/name', $name); |
|
| 158 | 158 | |
| 159 | - \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub ); |
|
| 159 | + \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\'.$name, $managerStub); |
|
| 160 | 160 | |
| 161 | 161 | |
| 162 | - $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' ) |
|
| 163 | - ->will( $this->returnValue( $listManagerStub ) ); |
|
| 162 | + $managerStub->expects($this->atLeastOnce())->method('getSubManager') |
|
| 163 | + ->will($this->returnValue($listManagerStub)); |
|
| 164 | 164 | |
| 165 | - $listManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 166 | - $listManagerStub->expects( $this->once() )->method( 'moveItem' ); |
|
| 165 | + $listManagerStub->expects($this->once())->method('saveItem'); |
|
| 166 | + $listManagerStub->expects($this->once())->method('moveItem'); |
|
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | $this->object->process(); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | public function testProcessEditItem() |
| 174 | 174 | { |
| 175 | - $this->context->setUserId( '123' ); |
|
| 175 | + $this->context->setUserId('123'); |
|
| 176 | 176 | |
| 177 | 177 | $view = $this->object->getView(); |
| 178 | 178 | $param = array( |
@@ -180,36 +180,36 @@ discard block |
||
| 180 | 180 | 'wat_id' => 321, |
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 184 | - $view->addHelper( 'param', $helper ); |
|
| 183 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 184 | + $view->addHelper('param', $helper); |
|
| 185 | 185 | |
| 186 | 186 | |
| 187 | - $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' ) |
|
| 188 | - ->setMethods( array( 'saveItem', 'searchItems' ) ) |
|
| 189 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 187 | + $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard') |
|
| 188 | + ->setMethods(array('saveItem', 'searchItems')) |
|
| 189 | + ->setConstructorArgs(array($this->context)) |
|
| 190 | 190 | ->getMock(); |
| 191 | 191 | |
| 192 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 193 | - ->setMethods( array( 'getSubManager' ) ) |
|
| 194 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 192 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 193 | + ->setMethods(array('getSubManager')) |
|
| 194 | + ->setConstructorArgs(array($this->context)) |
|
| 195 | 195 | ->getMock(); |
| 196 | 196 | |
| 197 | 197 | $name = 'ClientHtmlAccountWatchDefaultProcess'; |
| 198 | - $this->context->getConfig()->set( 'mshop/customer/manager/name', $name ); |
|
| 198 | + $this->context->getConfig()->set('mshop/customer/manager/name', $name); |
|
| 199 | 199 | |
| 200 | - \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub ); |
|
| 200 | + \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\'.$name, $managerStub); |
|
| 201 | 201 | |
| 202 | 202 | |
| 203 | 203 | $item = $listManagerStub->createItem(); |
| 204 | - $item->setRefId( 321 ); |
|
| 204 | + $item->setRefId(321); |
|
| 205 | 205 | |
| 206 | - $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' ) |
|
| 207 | - ->will( $this->returnValue( $listManagerStub ) ); |
|
| 206 | + $managerStub->expects($this->atLeastOnce())->method('getSubManager') |
|
| 207 | + ->will($this->returnValue($listManagerStub)); |
|
| 208 | 208 | |
| 209 | - $listManagerStub->expects( $this->once() )->method( 'searchItems' ) |
|
| 210 | - ->will( $this->returnValue( array( $item ) ) ); |
|
| 209 | + $listManagerStub->expects($this->once())->method('searchItems') |
|
| 210 | + ->will($this->returnValue(array($item))); |
|
| 211 | 211 | |
| 212 | - $listManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 212 | + $listManagerStub->expects($this->once())->method('saveItem'); |
|
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | $this->object->process(); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | public function testProcessDeleteItem() |
| 220 | 220 | { |
| 221 | - $this->context->setUserId( '123' ); |
|
| 221 | + $this->context->setUserId('123'); |
|
| 222 | 222 | |
| 223 | 223 | $view = $this->object->getView(); |
| 224 | 224 | $param = array( |
@@ -226,31 +226,31 @@ discard block |
||
| 226 | 226 | 'wat_id' => 321, |
| 227 | 227 | ); |
| 228 | 228 | |
| 229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 230 | - $view->addHelper( 'param', $helper ); |
|
| 229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 230 | + $view->addHelper('param', $helper); |
|
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | |
| 234 | - $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' ) |
|
| 235 | - ->setMethods( array( 'deleteItems' ) ) |
|
| 236 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 234 | + $listManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard') |
|
| 235 | + ->setMethods(array('deleteItems')) |
|
| 236 | + ->setConstructorArgs(array($this->context)) |
|
| 237 | 237 | ->getMock(); |
| 238 | 238 | |
| 239 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 240 | - ->setMethods( array( 'getSubManager' ) ) |
|
| 241 | - ->setConstructorArgs( array( $this->context ) ) |
|
| 239 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 240 | + ->setMethods(array('getSubManager')) |
|
| 241 | + ->setConstructorArgs(array($this->context)) |
|
| 242 | 242 | ->getMock(); |
| 243 | 243 | |
| 244 | 244 | $name = 'ClientHtmlAccountWatchDefaultProcess'; |
| 245 | - $this->context->getConfig()->set( 'mshop/customer/manager/name', $name ); |
|
| 245 | + $this->context->getConfig()->set('mshop/customer/manager/name', $name); |
|
| 246 | 246 | |
| 247 | - \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub ); |
|
| 247 | + \Aimeos\MShop\Customer\Manager\Factory::injectManager('\\Aimeos\\MShop\\Customer\\Manager\\'.$name, $managerStub); |
|
| 248 | 248 | |
| 249 | 249 | |
| 250 | - $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' ) |
|
| 251 | - ->will( $this->returnValue( $listManagerStub ) ); |
|
| 250 | + $managerStub->expects($this->atLeastOnce())->method('getSubManager') |
|
| 251 | + ->will($this->returnValue($listManagerStub)); |
|
| 252 | 252 | |
| 253 | - $listManagerStub->expects( $this->once() )->method( 'deleteItems' ); |
|
| 253 | + $listManagerStub->expects($this->once())->method('deleteItems'); |
|
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | $this->object->process(); |