@@ -10,154 +10,154 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class StandardTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - private $object; |
|
| 13 | + private $object; |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Sets up the fixture, for example, opens a network connection. |
|
| 18 | - * This method is called before a test is executed. |
|
| 19 | - * |
|
| 20 | - * @access protected |
|
| 21 | - */ |
|
| 22 | - protected function setUp() |
|
| 23 | - { |
|
| 24 | - $context = \TestHelperJobs::getContext(); |
|
| 25 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 16 | + /** |
|
| 17 | + * Sets up the fixture, for example, opens a network connection. |
|
| 18 | + * This method is called before a test is executed. |
|
| 19 | + * |
|
| 20 | + * @access protected |
|
| 21 | + */ |
|
| 22 | + protected function setUp() |
|
| 23 | + { |
|
| 24 | + $context = \TestHelperJobs::getContext(); |
|
| 25 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 26 | 26 | |
| 27 | - $this->object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 28 | - } |
|
| 27 | + $this->object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Tears down the fixture, for example, closes a network connection. |
|
| 33 | - * This method is called after a test is executed. |
|
| 34 | - * |
|
| 35 | - * @access protected |
|
| 36 | - */ |
|
| 37 | - protected function tearDown() |
|
| 38 | - { |
|
| 39 | - $this->object = null; |
|
| 40 | - } |
|
| 31 | + /** |
|
| 32 | + * Tears down the fixture, for example, closes a network connection. |
|
| 33 | + * This method is called after a test is executed. |
|
| 34 | + * |
|
| 35 | + * @access protected |
|
| 36 | + */ |
|
| 37 | + protected function tearDown() |
|
| 38 | + { |
|
| 39 | + $this->object = null; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function testGetName() |
|
| 44 | - { |
|
| 45 | - $this->assertEquals( 'Order payment related e-mails', $this->object->getName() ); |
|
| 46 | - } |
|
| 43 | + public function testGetName() |
|
| 44 | + { |
|
| 45 | + $this->assertEquals( 'Order payment related e-mails', $this->object->getName() ); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | - public function testGetDescription() |
|
| 50 | - { |
|
| 51 | - $text = 'Sends order confirmation or payment status update e-mails'; |
|
| 52 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 53 | - } |
|
| 49 | + public function testGetDescription() |
|
| 50 | + { |
|
| 51 | + $text = 'Sends order confirmation or payment status update e-mails'; |
|
| 52 | + $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - public function testRun() |
|
| 57 | - { |
|
| 58 | - $context = \TestHelperJobs::getContext(); |
|
| 59 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 56 | + public function testRun() |
|
| 57 | + { |
|
| 58 | + $context = \TestHelperJobs::getContext(); |
|
| 59 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 63 | - ->disableOriginalConstructor() |
|
| 64 | - ->getMock(); |
|
| 62 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 63 | + ->disableOriginalConstructor() |
|
| 64 | + ->getMock(); |
|
| 65 | 65 | |
| 66 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 67 | - ->disableOriginalConstructor() |
|
| 68 | - ->disableOriginalClone() |
|
| 69 | - ->getMock(); |
|
| 66 | + $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 67 | + ->disableOriginalConstructor() |
|
| 68 | + ->disableOriginalClone() |
|
| 69 | + ->getMock(); |
|
| 70 | 70 | |
| 71 | - $mailStub->expects( $this->once() ) |
|
| 72 | - ->method( 'createMessage' ) |
|
| 73 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 71 | + $mailStub->expects( $this->once() ) |
|
| 72 | + ->method( 'createMessage' ) |
|
| 73 | + ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 74 | 74 | |
| 75 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 75 | + $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 76 | 76 | |
| 77 | - $context->setMail( $mailStub ); |
|
| 77 | + $context->setMail( $mailStub ); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | - ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 80 | + $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | + ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | - $name = 'ControllerJobsEmailPaymentDefaultRun'; |
|
| 85 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 84 | + $name = 'ControllerJobsEmailPaymentDefaultRun'; |
|
| 85 | + $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 86 | 86 | |
| 87 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | - ->setConstructorArgs( array( $context ) ) |
|
| 90 | - ->getMock(); |
|
| 87 | + $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | + ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | + ->setConstructorArgs( array( $context ) ) |
|
| 90 | + ->getMock(); |
|
| 91 | 91 | |
| 92 | - $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | - ->setMethods( array( 'saveItem' ) ) |
|
| 94 | - ->setConstructorArgs( array( $context ) ) |
|
| 95 | - ->getMock(); |
|
| 92 | + $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | + ->setMethods( array( 'saveItem' ) ) |
|
| 94 | + ->setConstructorArgs( array( $context ) ) |
|
| 95 | + ->getMock(); |
|
| 96 | 96 | |
| 97 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | - ->setMethods( array( 'load' ) ) |
|
| 99 | - ->setConstructorArgs( array( $context ) ) |
|
| 100 | - ->getMock(); |
|
| 97 | + $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | + ->setMethods( array( 'load' ) ) |
|
| 99 | + ->setConstructorArgs( array( $context ) ) |
|
| 100 | + ->getMock(); |
|
| 101 | 101 | |
| 102 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 102 | + \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 106 | - $orderBaseItem = $orderBaseManagerStub->createItem(); |
|
| 107 | - $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 105 | + $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 106 | + $orderBaseItem = $orderBaseManagerStub->createItem(); |
|
| 107 | + $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | - ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 110 | + $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | + ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 112 | 112 | |
| 113 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 113 | + $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | + ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 115 | 115 | |
| 116 | - $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | - ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 116 | + $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | + ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 118 | 118 | |
| 119 | - $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 119 | + $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 123 | - $object->run(); |
|
| 124 | - } |
|
| 122 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 123 | + $object->run(); |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | - public function testRunException() |
|
| 128 | - { |
|
| 129 | - $context = \TestHelperJobs::getContext(); |
|
| 130 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 127 | + public function testRunException() |
|
| 128 | + { |
|
| 129 | + $context = \TestHelperJobs::getContext(); |
|
| 130 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 134 | - ->disableOriginalConstructor() |
|
| 135 | - ->getMock(); |
|
| 133 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 134 | + ->disableOriginalConstructor() |
|
| 135 | + ->getMock(); |
|
| 136 | 136 | |
| 137 | - $context->setMail( $mailStub ); |
|
| 137 | + $context->setMail( $mailStub ); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $name = 'ControllerJobsEmailPaymentDefaultRun'; |
|
| 141 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 140 | + $name = 'ControllerJobsEmailPaymentDefaultRun'; |
|
| 141 | + $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 142 | 142 | |
| 143 | 143 | |
| 144 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | - ->setMethods( array( 'searchItems' ) ) |
|
| 146 | - ->setConstructorArgs( array( $context ) ) |
|
| 147 | - ->getMock(); |
|
| 144 | + $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | + ->setMethods( array( 'searchItems' ) ) |
|
| 146 | + ->setConstructorArgs( array( $context ) ) |
|
| 147 | + ->getMock(); |
|
| 148 | 148 | |
| 149 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 149 | + \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | - $orderItem = $orderManagerStub->createItem(); |
|
| 152 | + $orderItem = $orderManagerStub->createItem(); |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 155 | + $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | + ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 157 | 157 | |
| 158 | 158 | |
| 159 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 160 | - $object->run(); |
|
| 161 | - } |
|
| 159 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 160 | + $object->run(); |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | 163 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $context = \TestHelperJobs::getContext(); |
| 25 | 25 | $aimeos = \TestHelperJobs::getAimeos(); |
| 26 | 26 | |
| 27 | - $this->object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 27 | + $this->object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard($context, $aimeos); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function testGetName() |
| 44 | 44 | { |
| 45 | - $this->assertEquals( 'Order payment related e-mails', $this->object->getName() ); |
|
| 45 | + $this->assertEquals('Order payment related e-mails', $this->object->getName()); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGetDescription() |
| 50 | 50 | { |
| 51 | 51 | $text = 'Sends order confirmation or payment status update e-mails'; |
| 52 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 52 | + $this->assertEquals($text, $this->object->getDescription()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -59,67 +59,67 @@ discard block |
||
| 59 | 59 | $aimeos = \TestHelperJobs::getAimeos(); |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 62 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 63 | 63 | ->disableOriginalConstructor() |
| 64 | 64 | ->getMock(); |
| 65 | 65 | |
| 66 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 66 | + $mailMsgStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\Message\\None') |
|
| 67 | 67 | ->disableOriginalConstructor() |
| 68 | 68 | ->disableOriginalClone() |
| 69 | 69 | ->getMock(); |
| 70 | 70 | |
| 71 | - $mailStub->expects( $this->once() ) |
|
| 72 | - ->method( 'createMessage' ) |
|
| 73 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 71 | + $mailStub->expects($this->once()) |
|
| 72 | + ->method('createMessage') |
|
| 73 | + ->will($this->returnValue($mailMsgStub)); |
|
| 74 | 74 | |
| 75 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 75 | + $mailStub->expects($this->once())->method('send'); |
|
| 76 | 76 | |
| 77 | - $context->setMail( $mailStub ); |
|
| 77 | + $context->setMail($mailStub); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | - ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 80 | + $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager($context) |
|
| 81 | + ->getSubManager('base')->getSubManager('address')->createItem(); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | $name = 'ControllerJobsEmailPaymentDefaultRun'; |
| 85 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 85 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 86 | 86 | |
| 87 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | - ->setConstructorArgs( array( $context ) ) |
|
| 87 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 88 | + ->setMethods(array('searchItems', 'getSubManager')) |
|
| 89 | + ->setConstructorArgs(array($context)) |
|
| 90 | 90 | ->getMock(); |
| 91 | 91 | |
| 92 | - $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | - ->setMethods( array( 'saveItem' ) ) |
|
| 94 | - ->setConstructorArgs( array( $context ) ) |
|
| 92 | + $orderStatusManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard') |
|
| 93 | + ->setMethods(array('saveItem')) |
|
| 94 | + ->setConstructorArgs(array($context)) |
|
| 95 | 95 | ->getMock(); |
| 96 | 96 | |
| 97 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | - ->setMethods( array( 'load' ) ) |
|
| 99 | - ->setConstructorArgs( array( $context ) ) |
|
| 97 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
| 98 | + ->setMethods(array('load')) |
|
| 99 | + ->setConstructorArgs(array($context)) |
|
| 100 | 100 | ->getMock(); |
| 101 | 101 | |
| 102 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 102 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\'.$name, $orderManagerStub); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 105 | + $orderItem = new \Aimeos\MShop\Order\Item\Standard(array('ctime' => '2000-01-01 00:00:00')); |
|
| 106 | 106 | $orderBaseItem = $orderBaseManagerStub->createItem(); |
| 107 | - $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 107 | + $orderBaseItem->setAddress($orderAddressItem); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | - ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 110 | + $orderManagerStub->expects($this->exactly(2))->method('getSubManager') |
|
| 111 | + ->will($this->onConsecutiveCalls($orderStatusManagerStub, $orderBaseManagerStub)); |
|
| 112 | 112 | |
| 113 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 113 | + $orderManagerStub->expects($this->exactly(4))->method('searchItems') |
|
| 114 | + ->will($this->onConsecutiveCalls(array($orderItem), array(), array(), array())); |
|
| 115 | 115 | |
| 116 | - $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | - ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 116 | + $orderBaseManagerStub->expects($this->once())->method('load') |
|
| 117 | + ->will($this->returnValue($orderBaseItem)); |
|
| 118 | 118 | |
| 119 | - $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 119 | + $orderStatusManagerStub->expects($this->once())->method('saveItem'); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 122 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard($context, $aimeos); |
|
| 123 | 123 | $object->run(); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -130,33 +130,33 @@ discard block |
||
| 130 | 130 | $aimeos = \TestHelperJobs::getAimeos(); |
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 133 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 134 | 134 | ->disableOriginalConstructor() |
| 135 | 135 | ->getMock(); |
| 136 | 136 | |
| 137 | - $context->setMail( $mailStub ); |
|
| 137 | + $context->setMail($mailStub); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | $name = 'ControllerJobsEmailPaymentDefaultRun'; |
| 141 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 141 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 142 | 142 | |
| 143 | 143 | |
| 144 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | - ->setMethods( array( 'searchItems' ) ) |
|
| 146 | - ->setConstructorArgs( array( $context ) ) |
|
| 144 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 145 | + ->setMethods(array('searchItems')) |
|
| 146 | + ->setConstructorArgs(array($context)) |
|
| 147 | 147 | ->getMock(); |
| 148 | 148 | |
| 149 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 149 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\'.$name, $orderManagerStub); |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | $orderItem = $orderManagerStub->createItem(); |
| 153 | 153 | |
| 154 | 154 | |
| 155 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 155 | + $orderManagerStub->expects($this->exactly(4))->method('searchItems') |
|
| 156 | + ->will($this->onConsecutiveCalls(array($orderItem), array(), array(), array())); |
|
| 157 | 157 | |
| 158 | 158 | |
| 159 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard( $context, $aimeos ); |
|
| 159 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Payment\Standard($context, $aimeos); |
|
| 160 | 160 | $object->run(); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -10,43 +10,43 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class FactoryTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - public function testCreateController() |
|
| 14 | - { |
|
| 15 | - $context = \TestHelperJobs::getContext(); |
|
| 16 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 13 | + public function testCreateController() |
|
| 14 | + { |
|
| 15 | + $context = \TestHelperJobs::getContext(); |
|
| 16 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | - } |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos ); |
|
| 19 | + $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public function testFactoryExceptionWrongName() |
|
| 24 | - { |
|
| 25 | - $context = \TestHelperJobs::getContext(); |
|
| 26 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 23 | + public function testFactoryExceptionWrongName() |
|
| 24 | + { |
|
| 25 | + $context = \TestHelperJobs::getContext(); |
|
| 26 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | - } |
|
| 28 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - public function testFactoryExceptionWrongClass() |
|
| 34 | - { |
|
| 35 | - $context = \TestHelperJobs::getContext(); |
|
| 36 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 33 | + public function testFactoryExceptionWrongClass() |
|
| 34 | + { |
|
| 35 | + $context = \TestHelperJobs::getContext(); |
|
| 36 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | - } |
|
| 38 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function testFactoryExceptionWrongInterface() |
|
| 44 | - { |
|
| 45 | - $context = \TestHelperJobs::getContext(); |
|
| 46 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 43 | + public function testFactoryExceptionWrongInterface() |
|
| 44 | + { |
|
| 45 | + $context = \TestHelperJobs::getContext(); |
|
| 46 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | - } |
|
| 48 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | $context = \TestHelperJobs::getContext(); |
| 16 | 16 | $aimeos = \TestHelperJobs::getAimeos(); |
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController($context, $aimeos); |
|
| 19 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | $context = \TestHelperJobs::getContext(); |
| 26 | 26 | $aimeos = \TestHelperJobs::getAimeos(); |
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 28 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 29 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | $context = \TestHelperJobs::getContext(); |
| 36 | 36 | $aimeos = \TestHelperJobs::getAimeos(); |
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 38 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 39 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController($context, $aimeos, 'WrongClass'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $context = \TestHelperJobs::getContext(); |
| 46 | 46 | $aimeos = \TestHelperJobs::getAimeos(); |
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 48 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 49 | + \Aimeos\Controller\Jobs\Order\Email\Payment\Factory::createController($context, $aimeos, 'Factory'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | } |
@@ -10,154 +10,154 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class StandardTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - private $object; |
|
| 13 | + private $object; |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Sets up the fixture, for example, opens a network connection. |
|
| 18 | - * This method is called before a test is executed. |
|
| 19 | - * |
|
| 20 | - * @access protected |
|
| 21 | - */ |
|
| 22 | - protected function setUp() |
|
| 23 | - { |
|
| 24 | - $context = \TestHelperJobs::getContext(); |
|
| 25 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 16 | + /** |
|
| 17 | + * Sets up the fixture, for example, opens a network connection. |
|
| 18 | + * This method is called before a test is executed. |
|
| 19 | + * |
|
| 20 | + * @access protected |
|
| 21 | + */ |
|
| 22 | + protected function setUp() |
|
| 23 | + { |
|
| 24 | + $context = \TestHelperJobs::getContext(); |
|
| 25 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 26 | 26 | |
| 27 | - $this->object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 28 | - } |
|
| 27 | + $this->object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Tears down the fixture, for example, closes a network connection. |
|
| 33 | - * This method is called after a test is executed. |
|
| 34 | - * |
|
| 35 | - * @access protected |
|
| 36 | - */ |
|
| 37 | - protected function tearDown() |
|
| 38 | - { |
|
| 39 | - $this->object = null; |
|
| 40 | - } |
|
| 31 | + /** |
|
| 32 | + * Tears down the fixture, for example, closes a network connection. |
|
| 33 | + * This method is called after a test is executed. |
|
| 34 | + * |
|
| 35 | + * @access protected |
|
| 36 | + */ |
|
| 37 | + protected function tearDown() |
|
| 38 | + { |
|
| 39 | + $this->object = null; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function testGetName() |
|
| 44 | - { |
|
| 45 | - $this->assertEquals( 'Order delivery related e-mails', $this->object->getName() ); |
|
| 46 | - } |
|
| 43 | + public function testGetName() |
|
| 44 | + { |
|
| 45 | + $this->assertEquals( 'Order delivery related e-mails', $this->object->getName() ); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | - public function testGetDescription() |
|
| 50 | - { |
|
| 51 | - $text = 'Sends order delivery status update e-mails'; |
|
| 52 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 53 | - } |
|
| 49 | + public function testGetDescription() |
|
| 50 | + { |
|
| 51 | + $text = 'Sends order delivery status update e-mails'; |
|
| 52 | + $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - public function testRun() |
|
| 57 | - { |
|
| 58 | - $context = \TestHelperJobs::getContext(); |
|
| 59 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 56 | + public function testRun() |
|
| 57 | + { |
|
| 58 | + $context = \TestHelperJobs::getContext(); |
|
| 59 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 63 | - ->disableOriginalConstructor() |
|
| 64 | - ->getMock(); |
|
| 62 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 63 | + ->disableOriginalConstructor() |
|
| 64 | + ->getMock(); |
|
| 65 | 65 | |
| 66 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 67 | - ->disableOriginalConstructor() |
|
| 68 | - ->disableOriginalClone() |
|
| 69 | - ->getMock(); |
|
| 66 | + $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 67 | + ->disableOriginalConstructor() |
|
| 68 | + ->disableOriginalClone() |
|
| 69 | + ->getMock(); |
|
| 70 | 70 | |
| 71 | - $mailStub->expects( $this->once() ) |
|
| 72 | - ->method( 'createMessage' ) |
|
| 73 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 71 | + $mailStub->expects( $this->once() ) |
|
| 72 | + ->method( 'createMessage' ) |
|
| 73 | + ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 74 | 74 | |
| 75 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 75 | + $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 76 | 76 | |
| 77 | - $context->setMail( $mailStub ); |
|
| 77 | + $context->setMail( $mailStub ); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | - ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 80 | + $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | + ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | - $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
|
| 85 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 84 | + $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
|
| 85 | + $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 86 | 86 | |
| 87 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | - ->setConstructorArgs( array( $context ) ) |
|
| 90 | - ->getMock(); |
|
| 87 | + $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | + ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | + ->setConstructorArgs( array( $context ) ) |
|
| 90 | + ->getMock(); |
|
| 91 | 91 | |
| 92 | - $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | - ->setMethods( array( 'saveItem' ) ) |
|
| 94 | - ->setConstructorArgs( array( $context ) ) |
|
| 95 | - ->getMock(); |
|
| 92 | + $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | + ->setMethods( array( 'saveItem' ) ) |
|
| 94 | + ->setConstructorArgs( array( $context ) ) |
|
| 95 | + ->getMock(); |
|
| 96 | 96 | |
| 97 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | - ->setMethods( array( 'load' ) ) |
|
| 99 | - ->setConstructorArgs( array( $context ) ) |
|
| 100 | - ->getMock(); |
|
| 97 | + $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | + ->setMethods( array( 'load' ) ) |
|
| 99 | + ->setConstructorArgs( array( $context ) ) |
|
| 100 | + ->getMock(); |
|
| 101 | 101 | |
| 102 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 102 | + \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 106 | - $orderBaseItem = $orderBaseManagerStub->createItem(); |
|
| 107 | - $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 105 | + $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 106 | + $orderBaseItem = $orderBaseManagerStub->createItem(); |
|
| 107 | + $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | - ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 110 | + $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | + ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 112 | 112 | |
| 113 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 113 | + $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | + ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 115 | 115 | |
| 116 | - $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | - ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 116 | + $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | + ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 118 | 118 | |
| 119 | - $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 119 | + $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 123 | - $object->run(); |
|
| 124 | - } |
|
| 122 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 123 | + $object->run(); |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | - public function testRunException() |
|
| 128 | - { |
|
| 129 | - $context = \TestHelperJobs::getContext(); |
|
| 130 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 127 | + public function testRunException() |
|
| 128 | + { |
|
| 129 | + $context = \TestHelperJobs::getContext(); |
|
| 130 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 134 | - ->disableOriginalConstructor() |
|
| 135 | - ->getMock(); |
|
| 133 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 134 | + ->disableOriginalConstructor() |
|
| 135 | + ->getMock(); |
|
| 136 | 136 | |
| 137 | - $context->setMail( $mailStub ); |
|
| 137 | + $context->setMail( $mailStub ); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
|
| 141 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 140 | + $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
|
| 141 | + $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 142 | 142 | |
| 143 | 143 | |
| 144 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | - ->setMethods( array( 'searchItems' ) ) |
|
| 146 | - ->setConstructorArgs( array( $context ) ) |
|
| 147 | - ->getMock(); |
|
| 144 | + $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | + ->setMethods( array( 'searchItems' ) ) |
|
| 146 | + ->setConstructorArgs( array( $context ) ) |
|
| 147 | + ->getMock(); |
|
| 148 | 148 | |
| 149 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 149 | + \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | - $orderItem = $orderManagerStub->createItem(); |
|
| 152 | + $orderItem = $orderManagerStub->createItem(); |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 155 | + $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | + ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 157 | 157 | |
| 158 | 158 | |
| 159 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 160 | - $object->run(); |
|
| 161 | - } |
|
| 159 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 160 | + $object->run(); |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | 163 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $context = \TestHelperJobs::getContext(); |
| 25 | 25 | $aimeos = \TestHelperJobs::getAimeos(); |
| 26 | 26 | |
| 27 | - $this->object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 27 | + $this->object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard($context, $aimeos); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function testGetName() |
| 44 | 44 | { |
| 45 | - $this->assertEquals( 'Order delivery related e-mails', $this->object->getName() ); |
|
| 45 | + $this->assertEquals('Order delivery related e-mails', $this->object->getName()); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGetDescription() |
| 50 | 50 | { |
| 51 | 51 | $text = 'Sends order delivery status update e-mails'; |
| 52 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 52 | + $this->assertEquals($text, $this->object->getDescription()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -59,67 +59,67 @@ discard block |
||
| 59 | 59 | $aimeos = \TestHelperJobs::getAimeos(); |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 62 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 63 | 63 | ->disableOriginalConstructor() |
| 64 | 64 | ->getMock(); |
| 65 | 65 | |
| 66 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 66 | + $mailMsgStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\Message\\None') |
|
| 67 | 67 | ->disableOriginalConstructor() |
| 68 | 68 | ->disableOriginalClone() |
| 69 | 69 | ->getMock(); |
| 70 | 70 | |
| 71 | - $mailStub->expects( $this->once() ) |
|
| 72 | - ->method( 'createMessage' ) |
|
| 73 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 71 | + $mailStub->expects($this->once()) |
|
| 72 | + ->method('createMessage') |
|
| 73 | + ->will($this->returnValue($mailMsgStub)); |
|
| 74 | 74 | |
| 75 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 75 | + $mailStub->expects($this->once())->method('send'); |
|
| 76 | 76 | |
| 77 | - $context->setMail( $mailStub ); |
|
| 77 | + $context->setMail($mailStub); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ) |
|
| 81 | - ->getSubManager( 'base' )->getSubManager( 'address' )->createItem(); |
|
| 80 | + $orderAddressItem = \Aimeos\MShop\Order\Manager\Factory::createManager($context) |
|
| 81 | + ->getSubManager('base')->getSubManager('address')->createItem(); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
| 85 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 85 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 86 | 86 | |
| 87 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 88 | - ->setMethods( array( 'searchItems', 'getSubManager' ) ) |
|
| 89 | - ->setConstructorArgs( array( $context ) ) |
|
| 87 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 88 | + ->setMethods(array('searchItems', 'getSubManager')) |
|
| 89 | + ->setConstructorArgs(array($context)) |
|
| 90 | 90 | ->getMock(); |
| 91 | 91 | |
| 92 | - $orderStatusManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard' ) |
|
| 93 | - ->setMethods( array( 'saveItem' ) ) |
|
| 94 | - ->setConstructorArgs( array( $context ) ) |
|
| 92 | + $orderStatusManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Status\\Standard') |
|
| 93 | + ->setMethods(array('saveItem')) |
|
| 94 | + ->setConstructorArgs(array($context)) |
|
| 95 | 95 | ->getMock(); |
| 96 | 96 | |
| 97 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
| 98 | - ->setMethods( array( 'load' ) ) |
|
| 99 | - ->setConstructorArgs( array( $context ) ) |
|
| 97 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
| 98 | + ->setMethods(array('load')) |
|
| 99 | + ->setConstructorArgs(array($context)) |
|
| 100 | 100 | ->getMock(); |
| 101 | 101 | |
| 102 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 102 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\'.$name, $orderManagerStub); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $orderItem = new \Aimeos\MShop\Order\Item\Standard( array( 'ctime' => '2000-01-01 00:00:00' ) ); |
|
| 105 | + $orderItem = new \Aimeos\MShop\Order\Item\Standard(array('ctime' => '2000-01-01 00:00:00')); |
|
| 106 | 106 | $orderBaseItem = $orderBaseManagerStub->createItem(); |
| 107 | - $orderBaseItem->setAddress( $orderAddressItem ); |
|
| 107 | + $orderBaseItem->setAddress($orderAddressItem); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $orderManagerStub->expects( $this->exactly( 2 ) )->method( 'getSubManager' ) |
|
| 111 | - ->will( $this->onConsecutiveCalls( $orderStatusManagerStub, $orderBaseManagerStub ) ); |
|
| 110 | + $orderManagerStub->expects($this->exactly(2))->method('getSubManager') |
|
| 111 | + ->will($this->onConsecutiveCalls($orderStatusManagerStub, $orderBaseManagerStub)); |
|
| 112 | 112 | |
| 113 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 114 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 113 | + $orderManagerStub->expects($this->exactly(4))->method('searchItems') |
|
| 114 | + ->will($this->onConsecutiveCalls(array($orderItem), array(), array(), array())); |
|
| 115 | 115 | |
| 116 | - $orderBaseManagerStub->expects( $this->once() )->method( 'load' ) |
|
| 117 | - ->will( $this->returnValue( $orderBaseItem ) ); |
|
| 116 | + $orderBaseManagerStub->expects($this->once())->method('load') |
|
| 117 | + ->will($this->returnValue($orderBaseItem)); |
|
| 118 | 118 | |
| 119 | - $orderStatusManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
| 119 | + $orderStatusManagerStub->expects($this->once())->method('saveItem'); |
|
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 122 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard($context, $aimeos); |
|
| 123 | 123 | $object->run(); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -130,33 +130,33 @@ discard block |
||
| 130 | 130 | $aimeos = \TestHelperJobs::getAimeos(); |
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 133 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 134 | 134 | ->disableOriginalConstructor() |
| 135 | 135 | ->getMock(); |
| 136 | 136 | |
| 137 | - $context->setMail( $mailStub ); |
|
| 137 | + $context->setMail($mailStub); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | $name = 'ControllerJobsEmailDeliveryDefaultRun'; |
| 141 | - $context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
| 141 | + $context->getConfig()->set('mshop/order/manager/name', $name); |
|
| 142 | 142 | |
| 143 | 143 | |
| 144 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
| 145 | - ->setMethods( array( 'searchItems' ) ) |
|
| 146 | - ->setConstructorArgs( array( $context ) ) |
|
| 144 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
| 145 | + ->setMethods(array('searchItems')) |
|
| 146 | + ->setConstructorArgs(array($context)) |
|
| 147 | 147 | ->getMock(); |
| 148 | 148 | |
| 149 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
| 149 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\'.$name, $orderManagerStub); |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | $orderItem = $orderManagerStub->createItem(); |
| 153 | 153 | |
| 154 | 154 | |
| 155 | - $orderManagerStub->expects( $this->exactly( 4 ) )->method( 'searchItems' ) |
|
| 156 | - ->will( $this->onConsecutiveCalls( array( $orderItem ), array(), array(), array() ) ); |
|
| 155 | + $orderManagerStub->expects($this->exactly(4))->method('searchItems') |
|
| 156 | + ->will($this->onConsecutiveCalls(array($orderItem), array(), array(), array())); |
|
| 157 | 157 | |
| 158 | 158 | |
| 159 | - $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard( $context, $aimeos ); |
|
| 159 | + $object = new \Aimeos\Controller\Jobs\Order\Email\Delivery\Standard($context, $aimeos); |
|
| 160 | 160 | $object->run(); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -10,43 +10,43 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class FactoryTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - public function testCreateController() |
|
| 14 | - { |
|
| 15 | - $context = \TestHelperJobs::getContext(); |
|
| 16 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 13 | + public function testCreateController() |
|
| 14 | + { |
|
| 15 | + $context = \TestHelperJobs::getContext(); |
|
| 16 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | - } |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos ); |
|
| 19 | + $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public function testFactoryExceptionWrongName() |
|
| 24 | - { |
|
| 25 | - $context = \TestHelperJobs::getContext(); |
|
| 26 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 23 | + public function testFactoryExceptionWrongName() |
|
| 24 | + { |
|
| 25 | + $context = \TestHelperJobs::getContext(); |
|
| 26 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | - } |
|
| 28 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - public function testFactoryExceptionWrongClass() |
|
| 34 | - { |
|
| 35 | - $context = \TestHelperJobs::getContext(); |
|
| 36 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 33 | + public function testFactoryExceptionWrongClass() |
|
| 34 | + { |
|
| 35 | + $context = \TestHelperJobs::getContext(); |
|
| 36 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | - } |
|
| 38 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function testFactoryExceptionWrongInterface() |
|
| 44 | - { |
|
| 45 | - $context = \TestHelperJobs::getContext(); |
|
| 46 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 43 | + public function testFactoryExceptionWrongInterface() |
|
| 44 | + { |
|
| 45 | + $context = \TestHelperJobs::getContext(); |
|
| 46 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | - } |
|
| 48 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | $context = \TestHelperJobs::getContext(); |
| 16 | 16 | $aimeos = \TestHelperJobs::getAimeos(); |
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController($context, $aimeos); |
|
| 19 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | $context = \TestHelperJobs::getContext(); |
| 26 | 26 | $aimeos = \TestHelperJobs::getAimeos(); |
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 28 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 29 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | $context = \TestHelperJobs::getContext(); |
| 36 | 36 | $aimeos = \TestHelperJobs::getAimeos(); |
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 38 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 39 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController($context, $aimeos, 'WrongClass'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $context = \TestHelperJobs::getContext(); |
| 46 | 46 | $aimeos = \TestHelperJobs::getAimeos(); |
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 48 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 49 | + \Aimeos\Controller\Jobs\Order\Email\Delivery\Factory::createController($context, $aimeos, 'Factory'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | } |
@@ -10,98 +10,98 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class StandardTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - private $object; |
|
| 14 | - private $context; |
|
| 15 | - private $aimeos; |
|
| 13 | + private $object; |
|
| 14 | + private $context; |
|
| 15 | + private $aimeos; |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Sets up the fixture, for example, opens a network connection. |
|
| 20 | - * This method is called before a test is executed. |
|
| 21 | - * |
|
| 22 | - * @access protected |
|
| 23 | - */ |
|
| 24 | - protected function setUp() |
|
| 25 | - { |
|
| 26 | - $this->context = \TestHelperJobs::getContext(); |
|
| 27 | - $this->aimeos = \TestHelperJobs::getAimeos(); |
|
| 18 | + /** |
|
| 19 | + * Sets up the fixture, for example, opens a network connection. |
|
| 20 | + * This method is called before a test is executed. |
|
| 21 | + * |
|
| 22 | + * @access protected |
|
| 23 | + */ |
|
| 24 | + protected function setUp() |
|
| 25 | + { |
|
| 26 | + $this->context = \TestHelperJobs::getContext(); |
|
| 27 | + $this->aimeos = \TestHelperJobs::getAimeos(); |
|
| 28 | 28 | |
| 29 | - $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Account\Standard( $this->context, $this->aimeos ); |
|
| 30 | - } |
|
| 29 | + $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Account\Standard( $this->context, $this->aimeos ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Tears down the fixture, for example, closes a network connection. |
|
| 35 | - * This method is called after a test is executed. |
|
| 36 | - * |
|
| 37 | - * @access protected |
|
| 38 | - */ |
|
| 39 | - protected function tearDown() |
|
| 40 | - { |
|
| 41 | - $this->object = null; |
|
| 42 | - } |
|
| 33 | + /** |
|
| 34 | + * Tears down the fixture, for example, closes a network connection. |
|
| 35 | + * This method is called after a test is executed. |
|
| 36 | + * |
|
| 37 | + * @access protected |
|
| 38 | + */ |
|
| 39 | + protected function tearDown() |
|
| 40 | + { |
|
| 41 | + $this->object = null; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - public function testGetName() |
|
| 46 | - { |
|
| 47 | - $this->assertEquals( 'Customer account e-mails', $this->object->getName() ); |
|
| 48 | - } |
|
| 45 | + public function testGetName() |
|
| 46 | + { |
|
| 47 | + $this->assertEquals( 'Customer account e-mails', $this->object->getName() ); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | - public function testGetDescription() |
|
| 52 | - { |
|
| 53 | - $text = 'Sends e-mails for new customer accounts'; |
|
| 54 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 55 | - } |
|
| 51 | + public function testGetDescription() |
|
| 52 | + { |
|
| 53 | + $text = 'Sends e-mails for new customer accounts'; |
|
| 54 | + $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | - public function testRun() |
|
| 59 | - { |
|
| 60 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 61 | - ->disableOriginalConstructor() |
|
| 62 | - ->getMock(); |
|
| 58 | + public function testRun() |
|
| 59 | + { |
|
| 60 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 61 | + ->disableOriginalConstructor() |
|
| 62 | + ->getMock(); |
|
| 63 | 63 | |
| 64 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 65 | - ->disableOriginalConstructor() |
|
| 66 | - ->disableOriginalClone() |
|
| 67 | - ->getMock(); |
|
| 64 | + $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 65 | + ->disableOriginalConstructor() |
|
| 66 | + ->disableOriginalClone() |
|
| 67 | + ->getMock(); |
|
| 68 | 68 | |
| 69 | - $mailStub->expects( $this->once() ) |
|
| 70 | - ->method( 'createMessage' ) |
|
| 71 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 69 | + $mailStub->expects( $this->once() ) |
|
| 70 | + ->method( 'createMessage' ) |
|
| 71 | + ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 72 | 72 | |
| 73 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 74 | - $this->context->setMail( $mailStub ); |
|
| 73 | + $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 74 | + $this->context->setMail( $mailStub ); |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - $queueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Queue\\Standard' ) |
|
| 78 | - ->disableOriginalConstructor() |
|
| 79 | - ->getMock(); |
|
| 77 | + $queueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Queue\\Standard' ) |
|
| 78 | + ->disableOriginalConstructor() |
|
| 79 | + ->getMock(); |
|
| 80 | 80 | |
| 81 | - $queueStub->expects( $this->exactly( 2 ) )->method( 'get' ) |
|
| 82 | - ->will( $this->onConsecutiveCalls( new \Aimeos\MW\MQueue\Message\Standard( array( 'message' => '{}') ), null ) ); |
|
| 81 | + $queueStub->expects( $this->exactly( 2 ) )->method( 'get' ) |
|
| 82 | + ->will( $this->onConsecutiveCalls( new \Aimeos\MW\MQueue\Message\Standard( array( 'message' => '{}') ), null ) ); |
|
| 83 | 83 | |
| 84 | - $queueStub->expects( $this->once() )->method( 'del' ); |
|
| 84 | + $queueStub->expects( $this->once() )->method( 'del' ); |
|
| 85 | 85 | |
| 86 | 86 | |
| 87 | - $mqueueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Standard' ) |
|
| 88 | - ->disableOriginalConstructor() |
|
| 89 | - ->getMock(); |
|
| 87 | + $mqueueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Standard' ) |
|
| 88 | + ->disableOriginalConstructor() |
|
| 89 | + ->getMock(); |
|
| 90 | 90 | |
| 91 | - $mqueueStub->expects( $this->once() )->method( 'getQueue' ) |
|
| 92 | - ->will( $this->returnValue( $queueStub ) ); |
|
| 91 | + $mqueueStub->expects( $this->once() )->method( 'getQueue' ) |
|
| 92 | + ->will( $this->returnValue( $queueStub ) ); |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Manager\\Standard' ) |
|
| 96 | - ->disableOriginalConstructor() |
|
| 97 | - ->getMock(); |
|
| 95 | + $managerStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Manager\\Standard' ) |
|
| 96 | + ->disableOriginalConstructor() |
|
| 97 | + ->getMock(); |
|
| 98 | 98 | |
| 99 | - $managerStub->expects( $this->once() )->method( 'get' ) |
|
| 100 | - ->will( $this->returnValue( $mqueueStub ) ); |
|
| 99 | + $managerStub->expects( $this->once() )->method( 'get' ) |
|
| 100 | + ->will( $this->returnValue( $mqueueStub ) ); |
|
| 101 | 101 | |
| 102 | - $this->context->setMessageQueueManager( $managerStub ); |
|
| 102 | + $this->context->setMessageQueueManager( $managerStub ); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $this->object->run(); |
|
| 106 | - } |
|
| 105 | + $this->object->run(); |
|
| 106 | + } |
|
| 107 | 107 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->context = \TestHelperJobs::getContext(); |
| 27 | 27 | $this->aimeos = \TestHelperJobs::getAimeos(); |
| 28 | 28 | |
| 29 | - $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Account\Standard( $this->context, $this->aimeos ); |
|
| 29 | + $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Account\Standard($this->context, $this->aimeos); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -44,62 +44,62 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function testGetName() |
| 46 | 46 | { |
| 47 | - $this->assertEquals( 'Customer account e-mails', $this->object->getName() ); |
|
| 47 | + $this->assertEquals('Customer account e-mails', $this->object->getName()); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testGetDescription() |
| 52 | 52 | { |
| 53 | 53 | $text = 'Sends e-mails for new customer accounts'; |
| 54 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 54 | + $this->assertEquals($text, $this->object->getDescription()); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | public function testRun() |
| 59 | 59 | { |
| 60 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 60 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 61 | 61 | ->disableOriginalConstructor() |
| 62 | 62 | ->getMock(); |
| 63 | 63 | |
| 64 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 64 | + $mailMsgStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\Message\\None') |
|
| 65 | 65 | ->disableOriginalConstructor() |
| 66 | 66 | ->disableOriginalClone() |
| 67 | 67 | ->getMock(); |
| 68 | 68 | |
| 69 | - $mailStub->expects( $this->once() ) |
|
| 70 | - ->method( 'createMessage' ) |
|
| 71 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 69 | + $mailStub->expects($this->once()) |
|
| 70 | + ->method('createMessage') |
|
| 71 | + ->will($this->returnValue($mailMsgStub)); |
|
| 72 | 72 | |
| 73 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 74 | - $this->context->setMail( $mailStub ); |
|
| 73 | + $mailStub->expects($this->once())->method('send'); |
|
| 74 | + $this->context->setMail($mailStub); |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - $queueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Queue\\Standard' ) |
|
| 77 | + $queueStub = $this->getMockBuilder('\\Aimeos\\MW\\MQueue\\Queue\\Standard') |
|
| 78 | 78 | ->disableOriginalConstructor() |
| 79 | 79 | ->getMock(); |
| 80 | 80 | |
| 81 | - $queueStub->expects( $this->exactly( 2 ) )->method( 'get' ) |
|
| 82 | - ->will( $this->onConsecutiveCalls( new \Aimeos\MW\MQueue\Message\Standard( array( 'message' => '{}') ), null ) ); |
|
| 81 | + $queueStub->expects($this->exactly(2))->method('get') |
|
| 82 | + ->will($this->onConsecutiveCalls(new \Aimeos\MW\MQueue\Message\Standard(array('message' => '{}')), null)); |
|
| 83 | 83 | |
| 84 | - $queueStub->expects( $this->once() )->method( 'del' ); |
|
| 84 | + $queueStub->expects($this->once())->method('del'); |
|
| 85 | 85 | |
| 86 | 86 | |
| 87 | - $mqueueStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Standard' ) |
|
| 87 | + $mqueueStub = $this->getMockBuilder('\\Aimeos\\MW\\MQueue\\Standard') |
|
| 88 | 88 | ->disableOriginalConstructor() |
| 89 | 89 | ->getMock(); |
| 90 | 90 | |
| 91 | - $mqueueStub->expects( $this->once() )->method( 'getQueue' ) |
|
| 92 | - ->will( $this->returnValue( $queueStub ) ); |
|
| 91 | + $mqueueStub->expects($this->once())->method('getQueue') |
|
| 92 | + ->will($this->returnValue($queueStub)); |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MW\\MQueue\\Manager\\Standard' ) |
|
| 95 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MW\\MQueue\\Manager\\Standard') |
|
| 96 | 96 | ->disableOriginalConstructor() |
| 97 | 97 | ->getMock(); |
| 98 | 98 | |
| 99 | - $managerStub->expects( $this->once() )->method( 'get' ) |
|
| 100 | - ->will( $this->returnValue( $mqueueStub ) ); |
|
| 99 | + $managerStub->expects($this->once())->method('get') |
|
| 100 | + ->will($this->returnValue($mqueueStub)); |
|
| 101 | 101 | |
| 102 | - $this->context->setMessageQueueManager( $managerStub ); |
|
| 102 | + $this->context->setMessageQueueManager($managerStub); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | $this->object->run(); |
@@ -9,43 +9,43 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class FactoryTest extends \PHPUnit_Framework_TestCase |
| 11 | 11 | { |
| 12 | - public function testCreateController() |
|
| 13 | - { |
|
| 14 | - $context = \TestHelperJobs::getContext(); |
|
| 15 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 12 | + public function testCreateController() |
|
| 13 | + { |
|
| 14 | + $context = \TestHelperJobs::getContext(); |
|
| 15 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 16 | 16 | |
| 17 | - $obj = \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos ); |
|
| 18 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 19 | - } |
|
| 17 | + $obj = \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos ); |
|
| 18 | + $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - public function testFactoryExceptionWrongName() |
|
| 23 | - { |
|
| 24 | - $context = \TestHelperJobs::getContext(); |
|
| 25 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 22 | + public function testFactoryExceptionWrongName() |
|
| 23 | + { |
|
| 24 | + $context = \TestHelperJobs::getContext(); |
|
| 25 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 26 | 26 | |
| 27 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 28 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 29 | - } |
|
| 27 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 28 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - public function testFactoryExceptionWrongClass() |
|
| 33 | - { |
|
| 34 | - $context = \TestHelperJobs::getContext(); |
|
| 35 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 32 | + public function testFactoryExceptionWrongClass() |
|
| 33 | + { |
|
| 34 | + $context = \TestHelperJobs::getContext(); |
|
| 35 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 36 | 36 | |
| 37 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 38 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 39 | - } |
|
| 37 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 38 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | - public function testFactoryExceptionWrongInterface() |
|
| 43 | - { |
|
| 44 | - $context = \TestHelperJobs::getContext(); |
|
| 45 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 42 | + public function testFactoryExceptionWrongInterface() |
|
| 43 | + { |
|
| 44 | + $context = \TestHelperJobs::getContext(); |
|
| 45 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 46 | 46 | |
| 47 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 48 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 49 | - } |
|
| 47 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 48 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | } |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | $context = \TestHelperJobs::getContext(); |
| 15 | 15 | $aimeos = \TestHelperJobs::getAimeos(); |
| 16 | 16 | |
| 17 | - $obj = \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos ); |
|
| 18 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 17 | + $obj = \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController($context, $aimeos); |
|
| 18 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | $context = \TestHelperJobs::getContext(); |
| 25 | 25 | $aimeos = \TestHelperJobs::getAimeos(); |
| 26 | 26 | |
| 27 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 28 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 27 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 28 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | $context = \TestHelperJobs::getContext(); |
| 35 | 35 | $aimeos = \TestHelperJobs::getAimeos(); |
| 36 | 36 | |
| 37 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 38 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 37 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 38 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController($context, $aimeos, 'WrongClass'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $context = \TestHelperJobs::getContext(); |
| 45 | 45 | $aimeos = \TestHelperJobs::getAimeos(); |
| 46 | 46 | |
| 47 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 48 | - \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 48 | + \Aimeos\Controller\Jobs\Customer\Email\Account\Factory::createController($context, $aimeos, 'Factory'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | } |
@@ -10,127 +10,127 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class StandardTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - private $object; |
|
| 14 | - private $context; |
|
| 15 | - private $aimeos; |
|
| 13 | + private $object; |
|
| 14 | + private $context; |
|
| 15 | + private $aimeos; |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Sets up the fixture, for example, opens a network connection. |
|
| 20 | - * This method is called before a test is executed. |
|
| 21 | - * |
|
| 22 | - * @access protected |
|
| 23 | - */ |
|
| 24 | - protected function setUp() |
|
| 25 | - { |
|
| 26 | - $this->context = \TestHelperJobs::getContext(); |
|
| 27 | - $this->aimeos = \TestHelperJobs::getAimeos(); |
|
| 18 | + /** |
|
| 19 | + * Sets up the fixture, for example, opens a network connection. |
|
| 20 | + * This method is called before a test is executed. |
|
| 21 | + * |
|
| 22 | + * @access protected |
|
| 23 | + */ |
|
| 24 | + protected function setUp() |
|
| 25 | + { |
|
| 26 | + $this->context = \TestHelperJobs::getContext(); |
|
| 27 | + $this->aimeos = \TestHelperJobs::getAimeos(); |
|
| 28 | 28 | |
| 29 | - $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Watch\Standard( $this->context, $this->aimeos ); |
|
| 30 | - } |
|
| 29 | + $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Watch\Standard( $this->context, $this->aimeos ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Tears down the fixture, for example, closes a network connection. |
|
| 35 | - * This method is called after a test is executed. |
|
| 36 | - * |
|
| 37 | - * @access protected |
|
| 38 | - */ |
|
| 39 | - protected function tearDown() |
|
| 40 | - { |
|
| 41 | - $this->object = null; |
|
| 42 | - } |
|
| 33 | + /** |
|
| 34 | + * Tears down the fixture, for example, closes a network connection. |
|
| 35 | + * This method is called after a test is executed. |
|
| 36 | + * |
|
| 37 | + * @access protected |
|
| 38 | + */ |
|
| 39 | + protected function tearDown() |
|
| 40 | + { |
|
| 41 | + $this->object = null; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - public function testGetName() |
|
| 46 | - { |
|
| 47 | - $this->assertEquals( 'Product notification e-mails', $this->object->getName() ); |
|
| 48 | - } |
|
| 45 | + public function testGetName() |
|
| 46 | + { |
|
| 47 | + $this->assertEquals( 'Product notification e-mails', $this->object->getName() ); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | - public function testGetDescription() |
|
| 52 | - { |
|
| 53 | - $text = 'Sends e-mails for watched products'; |
|
| 54 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 55 | - } |
|
| 51 | + public function testGetDescription() |
|
| 52 | + { |
|
| 53 | + $text = 'Sends e-mails for watched products'; |
|
| 54 | + $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | - public function testRun() |
|
| 59 | - { |
|
| 60 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 61 | - ->disableOriginalConstructor() |
|
| 62 | - ->getMock(); |
|
| 58 | + public function testRun() |
|
| 59 | + { |
|
| 60 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 61 | + ->disableOriginalConstructor() |
|
| 62 | + ->getMock(); |
|
| 63 | 63 | |
| 64 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 65 | - ->disableOriginalConstructor() |
|
| 66 | - ->disableOriginalClone() |
|
| 67 | - ->getMock(); |
|
| 64 | + $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 65 | + ->disableOriginalConstructor() |
|
| 66 | + ->disableOriginalClone() |
|
| 67 | + ->getMock(); |
|
| 68 | 68 | |
| 69 | - $mailStub->expects( $this->once() ) |
|
| 70 | - ->method( 'createMessage' ) |
|
| 71 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 69 | + $mailStub->expects( $this->once() ) |
|
| 70 | + ->method( 'createMessage' ) |
|
| 71 | + ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 72 | 72 | |
| 73 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 73 | + $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 74 | 74 | |
| 75 | - $this->context->setMail( $mailStub ); |
|
| 75 | + $this->context->setMail( $mailStub ); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | - $product = $this->getProductItem(); |
|
| 79 | - $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 78 | + $product = $this->getProductItem(); |
|
| 79 | + $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 80 | 80 | |
| 81 | - $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 83 | - ->setMethods( array( 'getListProducts' ) ) |
|
| 84 | - ->getMock(); |
|
| 81 | + $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 82 | + ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 83 | + ->setMethods( array( 'getListProducts' ) ) |
|
| 84 | + ->getMock(); |
|
| 85 | 85 | |
| 86 | - $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 87 | - ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 86 | + $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 87 | + ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | - $object->run(); |
|
| 91 | - } |
|
| 90 | + $object->run(); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | 93 | |
| 94 | - public function testRunException() |
|
| 95 | - { |
|
| 96 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 97 | - ->disableOriginalConstructor() |
|
| 98 | - ->getMock(); |
|
| 94 | + public function testRunException() |
|
| 95 | + { |
|
| 96 | + $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 97 | + ->disableOriginalConstructor() |
|
| 98 | + ->getMock(); |
|
| 99 | 99 | |
| 100 | - $mailStub->expects( $this->once() ) |
|
| 101 | - ->method( 'createMessage' ) |
|
| 102 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 100 | + $mailStub->expects( $this->once() ) |
|
| 101 | + ->method( 'createMessage' ) |
|
| 102 | + ->will( $this->throwException( new \Exception() ) ); |
|
| 103 | 103 | |
| 104 | - $this->context->setMail( $mailStub ); |
|
| 104 | + $this->context->setMail( $mailStub ); |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | - $product = $this->getProductItem(); |
|
| 108 | - $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 107 | + $product = $this->getProductItem(); |
|
| 108 | + $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 109 | 109 | |
| 110 | - $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 111 | - ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 112 | - ->setMethods( array( 'getListProducts' ) ) |
|
| 113 | - ->getMock(); |
|
| 110 | + $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 111 | + ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 112 | + ->setMethods( array( 'getListProducts' ) ) |
|
| 113 | + ->getMock(); |
|
| 114 | 114 | |
| 115 | - $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 116 | - ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 115 | + $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 116 | + ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | - $object->run(); |
|
| 120 | - } |
|
| 119 | + $object->run(); |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | 122 | |
| 123 | - protected function getProductItem() |
|
| 124 | - { |
|
| 125 | - $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context ); |
|
| 126 | - $search = $manager->createSearch(); |
|
| 127 | - $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) ); |
|
| 128 | - $items = $manager->searchItems( $search, array( 'media', 'price', 'text' ) ); |
|
| 123 | + protected function getProductItem() |
|
| 124 | + { |
|
| 125 | + $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context ); |
|
| 126 | + $search = $manager->createSearch(); |
|
| 127 | + $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) ); |
|
| 128 | + $items = $manager->searchItems( $search, array( 'media', 'price', 'text' ) ); |
|
| 129 | 129 | |
| 130 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 131 | - throw new \Exception( 'No product item with code "CNC" found' ); |
|
| 132 | - } |
|
| 130 | + if( ( $item = reset( $items ) ) === false ) { |
|
| 131 | + throw new \Exception( 'No product item with code "CNC" found' ); |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | - return $item; |
|
| 135 | - } |
|
| 134 | + return $item; |
|
| 135 | + } |
|
| 136 | 136 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->context = \TestHelperJobs::getContext(); |
| 27 | 27 | $this->aimeos = \TestHelperJobs::getAimeos(); |
| 28 | 28 | |
| 29 | - $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Watch\Standard( $this->context, $this->aimeos ); |
|
| 29 | + $this->object = new \Aimeos\Controller\Jobs\Customer\Email\Watch\Standard($this->context, $this->aimeos); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -44,47 +44,47 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function testGetName() |
| 46 | 46 | { |
| 47 | - $this->assertEquals( 'Product notification e-mails', $this->object->getName() ); |
|
| 47 | + $this->assertEquals('Product notification e-mails', $this->object->getName()); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public function testGetDescription() |
| 52 | 52 | { |
| 53 | 53 | $text = 'Sends e-mails for watched products'; |
| 54 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
| 54 | + $this->assertEquals($text, $this->object->getDescription()); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | public function testRun() |
| 59 | 59 | { |
| 60 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 60 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 61 | 61 | ->disableOriginalConstructor() |
| 62 | 62 | ->getMock(); |
| 63 | 63 | |
| 64 | - $mailMsgStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\Message\\None' ) |
|
| 64 | + $mailMsgStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\Message\\None') |
|
| 65 | 65 | ->disableOriginalConstructor() |
| 66 | 66 | ->disableOriginalClone() |
| 67 | 67 | ->getMock(); |
| 68 | 68 | |
| 69 | - $mailStub->expects( $this->once() ) |
|
| 70 | - ->method( 'createMessage' ) |
|
| 71 | - ->will( $this->returnValue( $mailMsgStub ) ); |
|
| 69 | + $mailStub->expects($this->once()) |
|
| 70 | + ->method('createMessage') |
|
| 71 | + ->will($this->returnValue($mailMsgStub)); |
|
| 72 | 72 | |
| 73 | - $mailStub->expects( $this->once() )->method( 'send' ); |
|
| 73 | + $mailStub->expects($this->once())->method('send'); |
|
| 74 | 74 | |
| 75 | - $this->context->setMail( $mailStub ); |
|
| 75 | + $this->context->setMail($mailStub); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | $product = $this->getProductItem(); |
| 79 | - $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 79 | + $prices = $product->getRefItems('price', 'default', 'default'); |
|
| 80 | 80 | |
| 81 | - $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 82 | - ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 83 | - ->setMethods( array( 'getListProducts' ) ) |
|
| 81 | + $object = $this->getMockBuilder('\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard') |
|
| 82 | + ->setConstructorArgs(array($this->context, $this->aimeos)) |
|
| 83 | + ->setMethods(array('getListProducts')) |
|
| 84 | 84 | ->getMock(); |
| 85 | 85 | |
| 86 | - $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 87 | - ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 86 | + $object->expects($this->once())->method('getListProducts') |
|
| 87 | + ->will($this->returnValue(array( -1 => array('item' => $product, 'price' => reset($prices)) ))); |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | $object->run(); |
@@ -93,27 +93,27 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function testRunException() |
| 95 | 95 | { |
| 96 | - $mailStub = $this->getMockBuilder( '\\Aimeos\\MW\\Mail\\None' ) |
|
| 96 | + $mailStub = $this->getMockBuilder('\\Aimeos\\MW\\Mail\\None') |
|
| 97 | 97 | ->disableOriginalConstructor() |
| 98 | 98 | ->getMock(); |
| 99 | 99 | |
| 100 | - $mailStub->expects( $this->once() ) |
|
| 101 | - ->method( 'createMessage' ) |
|
| 102 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 100 | + $mailStub->expects($this->once()) |
|
| 101 | + ->method('createMessage') |
|
| 102 | + ->will($this->throwException(new \Exception())); |
|
| 103 | 103 | |
| 104 | - $this->context->setMail( $mailStub ); |
|
| 104 | + $this->context->setMail($mailStub); |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | $product = $this->getProductItem(); |
| 108 | - $prices = $product->getRefItems( 'price', 'default', 'default' ); |
|
| 108 | + $prices = $product->getRefItems('price', 'default', 'default'); |
|
| 109 | 109 | |
| 110 | - $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard' ) |
|
| 111 | - ->setConstructorArgs( array( $this->context, $this->aimeos ) ) |
|
| 112 | - ->setMethods( array( 'getListProducts' ) ) |
|
| 110 | + $object = $this->getMockBuilder('\\Aimeos\\Controller\\Jobs\\Customer\\Email\\Watch\\Standard') |
|
| 111 | + ->setConstructorArgs(array($this->context, $this->aimeos)) |
|
| 112 | + ->setMethods(array('getListProducts')) |
|
| 113 | 113 | ->getMock(); |
| 114 | 114 | |
| 115 | - $object->expects( $this->once() )->method( 'getListProducts' ) |
|
| 116 | - ->will( $this->returnValue( array( -1 => array( 'item' => $product, 'price' => reset( $prices ) ) ) ) ); |
|
| 115 | + $object->expects($this->once())->method('getListProducts') |
|
| 116 | + ->will($this->returnValue(array( -1 => array('item' => $product, 'price' => reset($prices)) ))); |
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | $object->run(); |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | protected function getProductItem() |
| 124 | 124 | { |
| 125 | - $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context ); |
|
| 125 | + $manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context); |
|
| 126 | 126 | $search = $manager->createSearch(); |
| 127 | - $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) ); |
|
| 128 | - $items = $manager->searchItems( $search, array( 'media', 'price', 'text' ) ); |
|
| 127 | + $search->setConditions($search->compare('==', 'product.code', 'CNC')); |
|
| 128 | + $items = $manager->searchItems($search, array('media', 'price', 'text')); |
|
| 129 | 129 | |
| 130 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 131 | - throw new \Exception( 'No product item with code "CNC" found' ); |
|
| 130 | + if (($item = reset($items)) === false) { |
|
| 131 | + throw new \Exception('No product item with code "CNC" found'); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | return $item; |
@@ -10,43 +10,43 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class FactoryTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - public function testCreateController() |
|
| 14 | - { |
|
| 15 | - $context = \TestHelperJobs::getContext(); |
|
| 16 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 13 | + public function testCreateController() |
|
| 14 | + { |
|
| 15 | + $context = \TestHelperJobs::getContext(); |
|
| 16 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | - } |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos ); |
|
| 19 | + $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public function testFactoryExceptionWrongName() |
|
| 24 | - { |
|
| 25 | - $context = \TestHelperJobs::getContext(); |
|
| 26 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 23 | + public function testFactoryExceptionWrongName() |
|
| 24 | + { |
|
| 25 | + $context = \TestHelperJobs::getContext(); |
|
| 26 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | - } |
|
| 28 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - public function testFactoryExceptionWrongClass() |
|
| 34 | - { |
|
| 35 | - $context = \TestHelperJobs::getContext(); |
|
| 36 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 33 | + public function testFactoryExceptionWrongClass() |
|
| 34 | + { |
|
| 35 | + $context = \TestHelperJobs::getContext(); |
|
| 36 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | - } |
|
| 38 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function testFactoryExceptionWrongInterface() |
|
| 44 | - { |
|
| 45 | - $context = \TestHelperJobs::getContext(); |
|
| 46 | - $aimeos = \TestHelperJobs::getAimeos(); |
|
| 43 | + public function testFactoryExceptionWrongInterface() |
|
| 44 | + { |
|
| 45 | + $context = \TestHelperJobs::getContext(); |
|
| 46 | + $aimeos = \TestHelperJobs::getAimeos(); |
|
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | - } |
|
| 48 | + $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | $context = \TestHelperJobs::getContext(); |
| 16 | 16 | $aimeos = \TestHelperJobs::getAimeos(); |
| 17 | 17 | |
| 18 | - $obj = \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos ); |
|
| 19 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj ); |
|
| 18 | + $obj = \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController($context, $aimeos); |
|
| 19 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | $context = \TestHelperJobs::getContext(); |
| 26 | 26 | $aimeos = \TestHelperJobs::getAimeos(); |
| 27 | 27 | |
| 28 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 29 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
| 28 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 29 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | $context = \TestHelperJobs::getContext(); |
| 36 | 36 | $aimeos = \TestHelperJobs::getAimeos(); |
| 37 | 37 | |
| 38 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 39 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
| 38 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 39 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController($context, $aimeos, 'WrongClass'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $context = \TestHelperJobs::getContext(); |
| 46 | 46 | $aimeos = \TestHelperJobs::getAimeos(); |
| 47 | 47 | |
| 48 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 49 | - \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController( $context, $aimeos, 'Factory' ); |
|
| 48 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 49 | + \Aimeos\Controller\Jobs\Customer\Email\Watch\Factory::createController($context, $aimeos, 'Factory'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | } |
@@ -8,132 +8,132 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | class TestHelperJobs |
| 10 | 10 | { |
| 11 | - private static $aimeos; |
|
| 12 | - private static $context; |
|
| 11 | + private static $aimeos; |
|
| 12 | + private static $context; |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | - public static function bootstrap() |
|
| 16 | - { |
|
| 17 | - self::getAimeos(); |
|
| 18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 19 | - } |
|
| 15 | + public static function bootstrap() |
|
| 16 | + { |
|
| 17 | + self::getAimeos(); |
|
| 18 | + \Aimeos\MShop\Factory::setCache( false ); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - public static function getContext( $site = 'unittest' ) |
|
| 23 | - { |
|
| 24 | - if( !isset( self::$context[$site] ) ) { |
|
| 25 | - self::$context[$site] = self::createContext( $site ); |
|
| 26 | - } |
|
| 22 | + public static function getContext( $site = 'unittest' ) |
|
| 23 | + { |
|
| 24 | + if( !isset( self::$context[$site] ) ) { |
|
| 25 | + self::$context[$site] = self::createContext( $site ); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - return clone self::$context[$site]; |
|
| 29 | - } |
|
| 28 | + return clone self::$context[$site]; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - public static function getAimeos() |
|
| 33 | - { |
|
| 34 | - if( !isset( self::$aimeos ) ) |
|
| 35 | - { |
|
| 36 | - require_once 'Bootstrap.php'; |
|
| 37 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 32 | + public static function getAimeos() |
|
| 33 | + { |
|
| 34 | + if( !isset( self::$aimeos ) ) |
|
| 35 | + { |
|
| 36 | + require_once 'Bootstrap.php'; |
|
| 37 | + spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 38 | 38 | |
| 39 | - $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
| 40 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
| 41 | - } |
|
| 39 | + $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
| 40 | + self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - return self::$aimeos; |
|
| 44 | - } |
|
| 43 | + return self::$aimeos; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | - public static function getControllerPaths() |
|
| 48 | - { |
|
| 49 | - return self::getAimeos()->getCustomPaths( 'controller/jobs' ); |
|
| 50 | - } |
|
| 47 | + public static function getControllerPaths() |
|
| 48 | + { |
|
| 49 | + return self::getAimeos()->getCustomPaths( 'controller/jobs' ); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @param string $site |
|
| 55 | - */ |
|
| 56 | - private static function createContext( $site ) |
|
| 57 | - { |
|
| 58 | - $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
|
| 59 | - $aimeos = self::getAimeos(); |
|
| 53 | + /** |
|
| 54 | + * @param string $site |
|
| 55 | + */ |
|
| 56 | + private static function createContext( $site ) |
|
| 57 | + { |
|
| 58 | + $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
|
| 59 | + $aimeos = self::getAimeos(); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 63 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
| 64 | - $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
|
| 62 | + $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 63 | + $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
| 64 | + $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
|
| 65 | 65 | |
| 66 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 67 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 68 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 69 | - $ctx->setConfig( $conf ); |
|
| 66 | + $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 67 | + $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 68 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 69 | + $ctx->setConfig( $conf ); |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 73 | - $ctx->setLogger( $logger ); |
|
| 72 | + $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 73 | + $ctx->setLogger( $logger ); |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 77 | - $ctx->setDatabaseManager( $dbm ); |
|
| 76 | + $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 77 | + $ctx->setDatabaseManager( $dbm ); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 81 | - $ctx->setFilesystemManager( $fs ); |
|
| 80 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 81 | + $ctx->setFilesystemManager( $fs ); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
| 85 | - $ctx->setMessageQueueManager( $mq ); |
|
| 84 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
| 85 | + $ctx->setMessageQueueManager( $mq ); |
|
| 86 | 86 | |
| 87 | 87 | |
| 88 | - $session = new \Aimeos\MW\Session\None(); |
|
| 89 | - $ctx->setSession( $session ); |
|
| 88 | + $session = new \Aimeos\MW\Session\None(); |
|
| 89 | + $ctx->setSession( $session ); |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 93 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 92 | + $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 93 | + $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 97 | - $locale = $localeManager->bootstrap( $site, 'de', '', false ); |
|
| 98 | - $ctx->setLocale( $locale ); |
|
| 96 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 97 | + $locale = $localeManager->bootstrap( $site, 'de', '', false ); |
|
| 98 | + $ctx->setLocale( $locale ); |
|
| 99 | 99 | |
| 100 | 100 | |
| 101 | - $view = self::createView( $conf ); |
|
| 102 | - $ctx->setView( $view ); |
|
| 101 | + $view = self::createView( $conf ); |
|
| 102 | + $ctx->setView( $view ); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $ctx->setEditor( 'core:controller/jobs' ); |
|
| 105 | + $ctx->setEditor( 'core:controller/jobs' ); |
|
| 106 | 106 | |
| 107 | - return $ctx; |
|
| 108 | - } |
|
| 107 | + return $ctx; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | 110 | |
| 111 | - protected static function createView( \Aimeos\MW\Config\Iface $config ) |
|
| 112 | - { |
|
| 113 | - $tmplpaths = array_merge_recursive( |
|
| 114 | - self::getAimeos()->getCustomPaths( 'client/html/templates' ), |
|
| 115 | - self::getAimeos()->getCustomPaths( 'controller/jobs/templates' ) |
|
| 116 | - ); |
|
| 111 | + protected static function createView( \Aimeos\MW\Config\Iface $config ) |
|
| 112 | + { |
|
| 113 | + $tmplpaths = array_merge_recursive( |
|
| 114 | + self::getAimeos()->getCustomPaths( 'client/html/templates' ), |
|
| 115 | + self::getAimeos()->getCustomPaths( 'controller/jobs/templates' ) |
|
| 116 | + ); |
|
| 117 | 117 | |
| 118 | - $view = new \Aimeos\MW\View\Standard( $tmplpaths ); |
|
| 118 | + $view = new \Aimeos\MW\View\Standard( $tmplpaths ); |
|
| 119 | 119 | |
| 120 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 121 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 122 | - $view->addHelper( 'translate', $helper ); |
|
| 120 | + $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 121 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 122 | + $view->addHelper( 'translate', $helper ); |
|
| 123 | 123 | |
| 124 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 125 | - $view->addHelper( 'url', $helper ); |
|
| 124 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 125 | + $view->addHelper( 'url', $helper ); |
|
| 126 | 126 | |
| 127 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 128 | - $view->addHelper( 'number', $helper ); |
|
| 127 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 128 | + $view->addHelper( 'number', $helper ); |
|
| 129 | 129 | |
| 130 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 131 | - $view->addHelper( 'date', $helper ); |
|
| 130 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 131 | + $view->addHelper( 'date', $helper ); |
|
| 132 | 132 | |
| 133 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'controller/jobs', 'client/html' ) ); |
|
| 134 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 135 | - $view->addHelper( 'config', $helper ); |
|
| 133 | + $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'controller/jobs', 'client/html' ) ); |
|
| 134 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 135 | + $view->addHelper( 'config', $helper ); |
|
| 136 | 136 | |
| 137 | - return $view; |
|
| 138 | - } |
|
| 137 | + return $view; |
|
| 138 | + } |
|
| 139 | 139 | } |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | public static function bootstrap() |
| 16 | 16 | { |
| 17 | 17 | self::getAimeos(); |
| 18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 18 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | |
| 22 | - public static function getContext( $site = 'unittest' ) |
|
| 22 | + public static function getContext($site = 'unittest') |
|
| 23 | 23 | { |
| 24 | - if( !isset( self::$context[$site] ) ) { |
|
| 25 | - self::$context[$site] = self::createContext( $site ); |
|
| 24 | + if (!isset(self::$context[$site])) { |
|
| 25 | + self::$context[$site] = self::createContext($site); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | return clone self::$context[$site]; |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public static function getAimeos() |
| 33 | 33 | { |
| 34 | - if( !isset( self::$aimeos ) ) |
|
| 34 | + if (!isset(self::$aimeos)) |
|
| 35 | 35 | { |
| 36 | 36 | require_once 'Bootstrap.php'; |
| 37 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 37 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 38 | 38 | |
| 39 | - $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
| 40 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
| 39 | + $extdir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); |
|
| 40 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return self::$aimeos; |
@@ -46,93 +46,93 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public static function getControllerPaths() |
| 48 | 48 | { |
| 49 | - return self::getAimeos()->getCustomPaths( 'controller/jobs' ); |
|
| 49 | + return self::getAimeos()->getCustomPaths('controller/jobs'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * @param string $site |
| 55 | 55 | */ |
| 56 | - private static function createContext( $site ) |
|
| 56 | + private static function createContext($site) |
|
| 57 | 57 | { |
| 58 | 58 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 59 | 59 | $aimeos = self::getAimeos(); |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 63 | - $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
|
| 64 | - $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
|
| 62 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 63 | + $paths[] = __DIR__.DIRECTORY_SEPARATOR.'config'; |
|
| 64 | + $file = __DIR__.DIRECTORY_SEPARATOR.'confdoc.ser'; |
|
| 65 | 65 | |
| 66 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 67 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 68 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 69 | - $ctx->setConfig( $conf ); |
|
| 66 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
| 67 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 68 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 69 | + $ctx->setConfig($conf); |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 73 | - $ctx->setLogger( $logger ); |
|
| 72 | + $logger = new \Aimeos\MW\Logger\File($site.'.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 73 | + $ctx->setLogger($logger); |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 77 | - $ctx->setDatabaseManager( $dbm ); |
|
| 76 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 77 | + $ctx->setDatabaseManager($dbm); |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 81 | - $ctx->setFilesystemManager( $fs ); |
|
| 80 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
| 81 | + $ctx->setFilesystemManager($fs); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
| 85 | - $ctx->setMessageQueueManager( $mq ); |
|
| 84 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($conf); |
|
| 85 | + $ctx->setMessageQueueManager($mq); |
|
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | $session = new \Aimeos\MW\Session\None(); |
| 89 | - $ctx->setSession( $session ); |
|
| 89 | + $ctx->setSession($session); |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 93 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 92 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 93 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 97 | - $locale = $localeManager->bootstrap( $site, 'de', '', false ); |
|
| 98 | - $ctx->setLocale( $locale ); |
|
| 96 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 97 | + $locale = $localeManager->bootstrap($site, 'de', '', false); |
|
| 98 | + $ctx->setLocale($locale); |
|
| 99 | 99 | |
| 100 | 100 | |
| 101 | - $view = self::createView( $conf ); |
|
| 102 | - $ctx->setView( $view ); |
|
| 101 | + $view = self::createView($conf); |
|
| 102 | + $ctx->setView($view); |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | - $ctx->setEditor( 'core:controller/jobs' ); |
|
| 105 | + $ctx->setEditor('core:controller/jobs'); |
|
| 106 | 106 | |
| 107 | 107 | return $ctx; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| 111 | - protected static function createView( \Aimeos\MW\Config\Iface $config ) |
|
| 111 | + protected static function createView(\Aimeos\MW\Config\Iface $config) |
|
| 112 | 112 | { |
| 113 | 113 | $tmplpaths = array_merge_recursive( |
| 114 | - self::getAimeos()->getCustomPaths( 'client/html/templates' ), |
|
| 115 | - self::getAimeos()->getCustomPaths( 'controller/jobs/templates' ) |
|
| 114 | + self::getAimeos()->getCustomPaths('client/html/templates'), |
|
| 115 | + self::getAimeos()->getCustomPaths('controller/jobs/templates') |
|
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - $view = new \Aimeos\MW\View\Standard( $tmplpaths ); |
|
| 118 | + $view = new \Aimeos\MW\View\Standard($tmplpaths); |
|
| 119 | 119 | |
| 120 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 121 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 122 | - $view->addHelper( 'translate', $helper ); |
|
| 120 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
| 121 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
| 122 | + $view->addHelper('translate', $helper); |
|
| 123 | 123 | |
| 124 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 125 | - $view->addHelper( 'url', $helper ); |
|
| 124 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
| 125 | + $view->addHelper('url', $helper); |
|
| 126 | 126 | |
| 127 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 128 | - $view->addHelper( 'number', $helper ); |
|
| 127 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
| 128 | + $view->addHelper('number', $helper); |
|
| 129 | 129 | |
| 130 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 131 | - $view->addHelper( 'date', $helper ); |
|
| 130 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
| 131 | + $view->addHelper('date', $helper); |
|
| 132 | 132 | |
| 133 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'controller/jobs', 'client/html' ) ); |
|
| 134 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 135 | - $view->addHelper( 'config', $helper ); |
|
| 133 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('controller/jobs', 'client/html')); |
|
| 134 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 135 | + $view->addHelper('config', $helper); |
|
| 136 | 136 | |
| 137 | 137 | return $view; |
| 138 | 138 | } |