@@ -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 | } |
@@ -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; |
@@ -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 | } |
@@ -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(); |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | $context = \TestHelperJobs::getContext(); |
15 | 15 | $aimeos = \TestHelperJobs::getAimeos(); |
16 | 16 | |
17 | - $object = new TestAbstract( $context, $aimeos ); |
|
17 | + $object = new TestAbstract($context, $aimeos); |
|
18 | 18 | |
19 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
20 | - $object->getTypeItemPublic( 'product/type', 'product', 'test' ); |
|
19 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
20 | + $object->getTypeItemPublic('product/type', 'product', 'test'); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | class TestAbstract extends \Aimeos\Controller\Jobs\Base |
27 | 27 | { |
28 | - public function getTypeItemPublic( $prefix, $domain, $code ) |
|
28 | + public function getTypeItemPublic($prefix, $domain, $code) |
|
29 | 29 | { |
30 | - $this->getTypeItem( $prefix, $domain, $code ); |
|
30 | + $this->getTypeItem($prefix, $domain, $code); |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |
@@ -11,22 +11,22 @@ |
||
11 | 11 | * Set error reporting to maximum |
12 | 12 | */ |
13 | 13 | error_reporting( -1 ); |
14 | -ini_set( 'display_errors', '1' ); |
|
14 | +ini_set('display_errors', '1'); |
|
15 | 15 | |
16 | -date_default_timezone_set( 'UTC' ); |
|
16 | +date_default_timezone_set('UTC'); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Set locale settings to reasonable defaults |
20 | 20 | */ |
21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
22 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
24 | -setlocale( LC_TIME, 'POSIX' ); |
|
21 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
22 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
24 | +setlocale(LC_TIME, 'POSIX'); |
|
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Set include path for tests |
28 | 28 | */ |
29 | -define( 'PATH_TESTS', __DIR__ ); |
|
29 | +define('PATH_TESTS', __DIR__); |
|
30 | 30 | |
31 | 31 | require_once 'TestHelperJobs.php'; |
32 | 32 | \TestHelperJobs::bootstrap(); |