@@ -123,7 +123,6 @@ discard block |
||
123 | 123 | { |
124 | 124 | /** |
125 | 125 | * @param string $classprefix |
126 | - * @param string $path |
|
127 | 126 | */ |
128 | 127 | public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
129 | 128 | \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix ) |
@@ -131,12 +130,19 @@ discard block |
||
131 | 130 | return self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
132 | 131 | } |
133 | 132 | |
133 | + /** |
|
134 | + * @param string $path |
|
135 | + */ |
|
134 | 136 | public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
135 | 137 | \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path ) |
136 | 138 | { |
137 | 139 | return self::addClientDecorators( $context, $client, $templatePaths, $path ); |
138 | 140 | } |
139 | 141 | |
142 | + /** |
|
143 | + * @param string $classname |
|
144 | + * @param string $interface |
|
145 | + */ |
|
140 | 146 | public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context, |
141 | 147 | $classname, $interface, $templatePath ) |
142 | 148 | { |
@@ -17,103 +17,103 @@ discard block |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | |
22 | 22 | $config = $this->context->getConfig(); |
23 | - $config->set( 'admin/jqadm/common/decorators/default', array() ); |
|
24 | - $config->set( 'admin/jqadm/decorators/global', array() ); |
|
25 | - $config->set( 'admin/jqadm/decorators/local', array() ); |
|
23 | + $config->set('admin/jqadm/common/decorators/default', array()); |
|
24 | + $config->set('admin/jqadm/decorators/global', array()); |
|
25 | + $config->set('admin/jqadm/decorators/local', array()); |
|
26 | 26 | |
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | public function testInjectClient() |
31 | 31 | { |
32 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
33 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
32 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
33 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
34 | 34 | |
35 | - $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
35 | + $iClient = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
36 | 36 | |
37 | - $this->assertSame( $client, $iClient ); |
|
37 | + $this->assertSame($client, $iClient); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testInjectClientReset() |
42 | 42 | { |
43 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
44 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client ); |
|
45 | - \Aimeos\Admin\JQAdm\Product\Factory::injectClient( '\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null ); |
|
43 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
44 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', $client); |
|
45 | + \Aimeos\Admin\JQAdm\Product\Factory::injectClient('\\Aimeos\\Admin\\JQAdm\\Product\\Standard', null); |
|
46 | 46 | |
47 | - $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
47 | + $new = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
48 | 48 | |
49 | - $this->assertNotSame( $client, $new ); |
|
49 | + $this->assertNotSame($client, $new); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testAddDecorators() |
54 | 54 | { |
55 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
55 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
56 | 56 | |
57 | - $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, |
|
58 | - array(), array( 'Cache' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
57 | + $result = \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, |
|
58 | + array(), array('Cache'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
59 | 59 | |
60 | - $this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result ); |
|
60 | + $this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testAddDecoratorsInvalidName() |
65 | 65 | { |
66 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
66 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
67 | 67 | |
68 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
69 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
70 | - array( '$' ), 'Test' ); |
|
68 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
69 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
70 | + array('$'), 'Test'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testAddDecoratorsInvalidClass() |
75 | 75 | { |
76 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
76 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
77 | 77 | |
78 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
79 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
80 | - array( 'Test' ), 'TestDecorator' ); |
|
78 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
79 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
80 | + array('Test'), 'TestDecorator'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | 84 | public function testAddDecoratorsInvalidInterface() |
85 | 85 | { |
86 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
86 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
87 | 87 | |
88 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
89 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $this->context, $client, array(), |
|
90 | - array( 'Test' ), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\' ); |
|
88 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
89 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addDecoratorsPublic($this->context, $client, array(), |
|
90 | + array('Test'), '\\Aimeos\\Admin\\JQAdm\\Common\\Decorator\\'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
94 | 94 | public function testAddClientDecoratorsExcludes() |
95 | 95 | { |
96 | - $this->context->getConfig()->set( 'admin/jqadm/decorators/excludes', array( 'TestDecorator' ) ); |
|
97 | - $this->context->getConfig()->set( 'admin/jqadm/common/decorators/default', array( 'TestDecorator' ) ); |
|
96 | + $this->context->getConfig()->set('admin/jqadm/decorators/excludes', array('TestDecorator')); |
|
97 | + $this->context->getConfig()->set('admin/jqadm/common/decorators/default', array('TestDecorator')); |
|
98 | 98 | |
99 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
100 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
99 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
100 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
104 | 104 | public function testAddClientDecoratorsEmptyPath() |
105 | 105 | { |
106 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, array(), 'Standard' ); |
|
106 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, array(), 'Standard'); |
|
107 | 107 | |
108 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
109 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic( $this->context, $client, array(), '' ); |
|
108 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
109 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::addClientDecoratorsPublic($this->context, $client, array(), ''); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testCreateClientBase() |
114 | 114 | { |
115 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
116 | - \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic( $this->context, 'Test', 'Test', array() ); |
|
115 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
116 | + \Aimeos\Admin\JQAdm\Common\Factory\TestAbstract::createClientBasePublic($this->context, 'Test', 'Test', array()); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -125,22 +125,22 @@ discard block |
||
125 | 125 | * @param string $classprefix |
126 | 126 | * @param string $path |
127 | 127 | */ |
128 | - public static function addDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
129 | - \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix ) |
|
128 | + public static function addDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
129 | + \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, array $decorators, $classprefix) |
|
130 | 130 | { |
131 | - return self::addDecorators( $context, $client, $templatePaths, $decorators, $classprefix ); |
|
131 | + return self::addDecorators($context, $client, $templatePaths, $decorators, $classprefix); |
|
132 | 132 | } |
133 | 133 | |
134 | - public static function addClientDecoratorsPublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
135 | - \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path ) |
|
134 | + public static function addClientDecoratorsPublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
135 | + \Aimeos\Admin\JQAdm\Iface $client, $templatePaths, $path) |
|
136 | 136 | { |
137 | - return self::addClientDecorators( $context, $client, $templatePaths, $path ); |
|
137 | + return self::addClientDecorators($context, $client, $templatePaths, $path); |
|
138 | 138 | } |
139 | 139 | |
140 | - public static function createClientBasePublic( \Aimeos\MShop\Context\Item\Iface $context, |
|
141 | - $classname, $interface, $templatePath ) |
|
140 | + public static function createClientBasePublic(\Aimeos\MShop\Context\Item\Iface $context, |
|
141 | + $classname, $interface, $templatePath) |
|
142 | 142 | { |
143 | - return self::createClientBase( $context, $classname, $interface, $templatePath ); |
|
143 | + return self::createClientBase($context, $classname, $interface, $templatePath); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | 19 | $this->view = \TestHelperJqadm::getView(); |
20 | - $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' ); |
|
21 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' ); |
|
22 | - $this->view ->addHelper( 'request', $helper ); |
|
20 | + $request = $this->getMock('\Psr\Http\Message\ServerRequestInterface'); |
|
21 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test'); |
|
22 | + $this->view ->addHelper('request', $helper); |
|
23 | 23 | |
24 | 24 | $this->context = \TestHelperJqadm::getContext(); |
25 | 25 | $templatePaths = \TestHelperJqadm::getTemplatePaths(); |
26 | 26 | |
27 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths ); |
|
28 | - $this->object->setView( $this->view ); |
|
27 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths); |
|
28 | + $this->object->setView($this->view); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | protected function tearDown() |
33 | 33 | { |
34 | - unset( $this->object ); |
|
34 | + unset($this->object); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | |
44 | 44 | public function testCreateException() |
45 | 45 | { |
46 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
47 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
48 | - ->setMethods( array( 'getSubClients' ) ) |
|
46 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
47 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
48 | + ->setMethods(array('getSubClients')) |
|
49 | 49 | ->getMock(); |
50 | 50 | |
51 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
52 | - ->will( $this->throwException( new \Exception() ) ); |
|
51 | + $object->expects($this->once())->method('getSubClients') |
|
52 | + ->will($this->throwException(new \Exception())); |
|
53 | 53 | |
54 | - $object->setView( $this->getViewNoRender() ); |
|
54 | + $object->setView($this->getViewNoRender()); |
|
55 | 55 | |
56 | 56 | $object->create(); |
57 | 57 | } |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | |
60 | 60 | public function testCreateMShopException() |
61 | 61 | { |
62 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
63 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
64 | - ->setMethods( array( 'getSubClients' ) ) |
|
62 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
63 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
64 | + ->setMethods(array('getSubClients')) |
|
65 | 65 | ->getMock(); |
66 | 66 | |
67 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
68 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
67 | + $object->expects($this->once())->method('getSubClients') |
|
68 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
69 | 69 | |
70 | - $object->setView( $this->getViewNoRender() ); |
|
70 | + $object->setView($this->getViewNoRender()); |
|
71 | 71 | |
72 | 72 | $object->create(); |
73 | 73 | } |
@@ -75,29 +75,29 @@ discard block |
||
75 | 75 | |
76 | 76 | public function testCopy() |
77 | 77 | { |
78 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
78 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
79 | 79 | |
80 | - $param = array( 'id' => $manager->findItem( 'CNC' )->getId() ); |
|
81 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
82 | - $this->view->addHelper( 'param', $helper ); |
|
80 | + $param = array('id' => $manager->findItem('CNC')->getId()); |
|
81 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
82 | + $this->view->addHelper('param', $helper); |
|
83 | 83 | |
84 | 84 | $result = $this->object->copy(); |
85 | 85 | |
86 | - $this->assertContains( 'CNC_copy', $result ); |
|
86 | + $this->assertContains('CNC_copy', $result); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | 90 | public function testCopyException() |
91 | 91 | { |
92 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
93 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
94 | - ->setMethods( array( 'getSubClients' ) ) |
|
92 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
93 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
94 | + ->setMethods(array('getSubClients')) |
|
95 | 95 | ->getMock(); |
96 | 96 | |
97 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
98 | - ->will( $this->throwException( new \Exception() ) ); |
|
97 | + $object->expects($this->once())->method('getSubClients') |
|
98 | + ->will($this->throwException(new \Exception())); |
|
99 | 99 | |
100 | - $object->setView( $this->getViewNoRender() ); |
|
100 | + $object->setView($this->getViewNoRender()); |
|
101 | 101 | |
102 | 102 | $object->copy(); |
103 | 103 | } |
@@ -105,15 +105,15 @@ discard block |
||
105 | 105 | |
106 | 106 | public function testCopyMShopException() |
107 | 107 | { |
108 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
109 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
110 | - ->setMethods( array( 'getSubClients' ) ) |
|
108 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
109 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
110 | + ->setMethods(array('getSubClients')) |
|
111 | 111 | ->getMock(); |
112 | 112 | |
113 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
114 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
113 | + $object->expects($this->once())->method('getSubClients') |
|
114 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
115 | 115 | |
116 | - $object->setView( $this->getViewNoRender() ); |
|
116 | + $object->setView($this->getViewNoRender()); |
|
117 | 117 | |
118 | 118 | $object->copy(); |
119 | 119 | } |
@@ -121,21 +121,21 @@ discard block |
||
121 | 121 | |
122 | 122 | public function testDelete() |
123 | 123 | { |
124 | - $this->assertNull( $this->object->delete() ); |
|
124 | + $this->assertNull($this->object->delete()); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
128 | 128 | public function testDeleteException() |
129 | 129 | { |
130 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
131 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
132 | - ->setMethods( array( 'getSubClients' ) ) |
|
130 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
131 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
132 | + ->setMethods(array('getSubClients')) |
|
133 | 133 | ->getMock(); |
134 | 134 | |
135 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
136 | - ->will( $this->throwException( new \Exception() ) ); |
|
135 | + $object->expects($this->once())->method('getSubClients') |
|
136 | + ->will($this->throwException(new \Exception())); |
|
137 | 137 | |
138 | - $object->setView( $this->getViewNoRender() ); |
|
138 | + $object->setView($this->getViewNoRender()); |
|
139 | 139 | |
140 | 140 | $object->delete(); |
141 | 141 | } |
@@ -143,15 +143,15 @@ discard block |
||
143 | 143 | |
144 | 144 | public function testDeleteMShopException() |
145 | 145 | { |
146 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
147 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
148 | - ->setMethods( array( 'getSubClients' ) ) |
|
146 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
147 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
148 | + ->setMethods(array('getSubClients')) |
|
149 | 149 | ->getMock(); |
150 | 150 | |
151 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
152 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
151 | + $object->expects($this->once())->method('getSubClients') |
|
152 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
153 | 153 | |
154 | - $object->setView( $this->getViewNoRender() ); |
|
154 | + $object->setView($this->getViewNoRender()); |
|
155 | 155 | |
156 | 156 | $object->delete(); |
157 | 157 | } |
@@ -159,29 +159,29 @@ discard block |
||
159 | 159 | |
160 | 160 | public function testGet() |
161 | 161 | { |
162 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
162 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
163 | 163 | |
164 | - $param = array( 'id' => $manager->findItem( 'CNC' )->getId() ); |
|
165 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
166 | - $this->view->addHelper( 'param', $helper ); |
|
164 | + $param = array('id' => $manager->findItem('CNC')->getId()); |
|
165 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
166 | + $this->view->addHelper('param', $helper); |
|
167 | 167 | |
168 | 168 | $result = $this->object->get(); |
169 | 169 | |
170 | - $this->assertContains( 'CNC', $result ); |
|
170 | + $this->assertContains('CNC', $result); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
174 | 174 | public function testGetException() |
175 | 175 | { |
176 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
177 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
178 | - ->setMethods( array( 'getSubClients' ) ) |
|
176 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
177 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
178 | + ->setMethods(array('getSubClients')) |
|
179 | 179 | ->getMock(); |
180 | 180 | |
181 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
182 | - ->will( $this->throwException( new \Exception() ) ); |
|
181 | + $object->expects($this->once())->method('getSubClients') |
|
182 | + ->will($this->throwException(new \Exception())); |
|
183 | 183 | |
184 | - $object->setView( $this->getViewNoRender() ); |
|
184 | + $object->setView($this->getViewNoRender()); |
|
185 | 185 | |
186 | 186 | $object->get(); |
187 | 187 | } |
@@ -189,15 +189,15 @@ discard block |
||
189 | 189 | |
190 | 190 | public function testGetMShopException() |
191 | 191 | { |
192 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
193 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
194 | - ->setMethods( array( 'getSubClients' ) ) |
|
192 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
193 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
194 | + ->setMethods(array('getSubClients')) |
|
195 | 195 | ->getMock(); |
196 | 196 | |
197 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
198 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
197 | + $object->expects($this->once())->method('getSubClients') |
|
198 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
199 | 199 | |
200 | - $object->setView( $this->getViewNoRender() ); |
|
200 | + $object->setView($this->getViewNoRender()); |
|
201 | 201 | |
202 | 202 | $object->get(); |
203 | 203 | } |
@@ -205,24 +205,24 @@ discard block |
||
205 | 205 | |
206 | 206 | public function testGetViewException() |
207 | 207 | { |
208 | - $object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, array() ); |
|
208 | + $object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, array()); |
|
209 | 209 | |
210 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
210 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
211 | 211 | $object->getView(); |
212 | 212 | } |
213 | 213 | |
214 | 214 | |
215 | 215 | public function testSave() |
216 | 216 | { |
217 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' ); |
|
218 | - $typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' ); |
|
217 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'product'); |
|
218 | + $typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/type'); |
|
219 | 219 | |
220 | 220 | $search = $typeManager->createSearch(); |
221 | - $search->setSlice( 0, 1 ); |
|
222 | - $typeItems = $typeManager->searchItems( $search ); |
|
221 | + $search->setSlice(0, 1); |
|
222 | + $typeItems = $typeManager->searchItems($search); |
|
223 | 223 | |
224 | - if( ( $typeItem = reset( $typeItems ) ) === false ) { |
|
225 | - throw new \Exception( 'No product type item found' ); |
|
224 | + if (($typeItem = reset($typeItems)) === false) { |
|
225 | + throw new \Exception('No product type item found'); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -235,42 +235,42 @@ discard block |
||
235 | 235 | 'product.datestart' => null, |
236 | 236 | 'product.dateend' => null, |
237 | 237 | 'config' => array( |
238 | - 'key' => array( 0 => 'test key' ), |
|
239 | - 'val' => array( 0 => 'test value' ), |
|
238 | + 'key' => array(0 => 'test key'), |
|
239 | + 'val' => array(0 => 'test value'), |
|
240 | 240 | ), |
241 | 241 | ), |
242 | 242 | ); |
243 | 243 | |
244 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
245 | - $this->view->addHelper( 'param', $helper ); |
|
244 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
245 | + $this->view->addHelper('param', $helper); |
|
246 | 246 | |
247 | 247 | $this->object->save(); |
248 | 248 | |
249 | - $manager->deleteItem( $manager->findItem( 'test' )->getId() ); |
|
249 | + $manager->deleteItem($manager->findItem('test')->getId()); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | public function testSaveException() |
254 | 254 | { |
255 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
256 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
257 | - ->setMethods( array( 'getSubClients' ) ) |
|
255 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
256 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
257 | + ->setMethods(array('getSubClients')) |
|
258 | 258 | ->getMock(); |
259 | 259 | |
260 | 260 | $name = 'AdminJQAdmStandard'; |
261 | - $this->context->getConfig()->set( 'mshop/product/manager/name', $name ); |
|
261 | + $this->context->getConfig()->set('mshop/product/manager/name', $name); |
|
262 | 262 | |
263 | - $mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' ) |
|
264 | - ->setConstructorArgs( array( $this->context ) ) |
|
265 | - ->setMethods( array( 'createItem' ) ) |
|
263 | + $mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard') |
|
264 | + ->setConstructorArgs(array($this->context)) |
|
265 | + ->setMethods(array('createItem')) |
|
266 | 266 | ->getMock(); |
267 | 267 | |
268 | - $mock->expects( $this->exactly( 2 ) )->method( 'createItem' ) |
|
269 | - ->will( $this->throwException( new \Exception() ) ); |
|
268 | + $mock->expects($this->exactly(2))->method('createItem') |
|
269 | + ->will($this->throwException(new \Exception())); |
|
270 | 270 | |
271 | - \Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock ); |
|
271 | + \Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock); |
|
272 | 272 | |
273 | - $object->setView( $this->getViewNoRender() ); |
|
273 | + $object->setView($this->getViewNoRender()); |
|
274 | 274 | |
275 | 275 | $object->save(); |
276 | 276 | } |
@@ -278,25 +278,25 @@ discard block |
||
278 | 278 | |
279 | 279 | public function testSaveMShopException() |
280 | 280 | { |
281 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
282 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
283 | - ->setMethods( array( 'getSubClients' ) ) |
|
281 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
282 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
283 | + ->setMethods(array('getSubClients')) |
|
284 | 284 | ->getMock(); |
285 | 285 | |
286 | 286 | $name = 'AdminJQAdmStandard'; |
287 | - $this->context->getConfig()->set( 'mshop/product/manager/name', $name ); |
|
287 | + $this->context->getConfig()->set('mshop/product/manager/name', $name); |
|
288 | 288 | |
289 | - $mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' ) |
|
290 | - ->setConstructorArgs( array( $this->context ) ) |
|
291 | - ->setMethods( array( 'createItem' ) ) |
|
289 | + $mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard') |
|
290 | + ->setConstructorArgs(array($this->context)) |
|
291 | + ->setMethods(array('createItem')) |
|
292 | 292 | ->getMock(); |
293 | 293 | |
294 | - $mock->expects( $this->exactly( 2 ) )->method( 'createItem' ) |
|
295 | - ->will( $this->throwException( new \Exception() ) ); |
|
294 | + $mock->expects($this->exactly(2))->method('createItem') |
|
295 | + ->will($this->throwException(new \Exception())); |
|
296 | 296 | |
297 | - \Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock ); |
|
297 | + \Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock); |
|
298 | 298 | |
299 | - $object->setView( $this->getViewNoRender() ); |
|
299 | + $object->setView($this->getViewNoRender()); |
|
300 | 300 | |
301 | 301 | $object->save(); |
302 | 302 | } |
@@ -307,32 +307,32 @@ discard block |
||
307 | 307 | $param = array( |
308 | 308 | 'site' => 'unittest', 'lang' => 'de', |
309 | 309 | 'filter' => array( |
310 | - 'key' => array( 0 => 'product.code' ), |
|
311 | - 'op' => array( 0 => '==' ), |
|
312 | - 'val' => array( 0 => 'CNE' ), |
|
310 | + 'key' => array(0 => 'product.code'), |
|
311 | + 'op' => array(0 => '=='), |
|
312 | + 'val' => array(0 => 'CNE'), |
|
313 | 313 | ), |
314 | - 'sort' => array( '+product.label', '-product.id' ), |
|
314 | + 'sort' => array('+product.label', '-product.id'), |
|
315 | 315 | ); |
316 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
317 | - $this->view->addHelper( 'param', $helper ); |
|
316 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
317 | + $this->view->addHelper('param', $helper); |
|
318 | 318 | |
319 | 319 | $result = $this->object->search(); |
320 | 320 | |
321 | - $this->assertContains( 'CNE', $result ); |
|
321 | + $this->assertContains('CNE', $result); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
325 | 325 | public function testSearchException() |
326 | 326 | { |
327 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
328 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
329 | - ->setMethods( array( 'getSubClients' ) ) |
|
327 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
328 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
329 | + ->setMethods(array('getSubClients')) |
|
330 | 330 | ->getMock(); |
331 | 331 | |
332 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
333 | - ->will( $this->throwException( new \Exception() ) ); |
|
332 | + $object->expects($this->once())->method('getSubClients') |
|
333 | + ->will($this->throwException(new \Exception())); |
|
334 | 334 | |
335 | - $object->setView( $this->getViewNoRender() ); |
|
335 | + $object->setView($this->getViewNoRender()); |
|
336 | 336 | |
337 | 337 | $object->search(); |
338 | 338 | } |
@@ -340,15 +340,15 @@ discard block |
||
340 | 340 | |
341 | 341 | public function testSearchMShopException() |
342 | 342 | { |
343 | - $object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' ) |
|
344 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
345 | - ->setMethods( array( 'getSubClients' ) ) |
|
343 | + $object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard') |
|
344 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
345 | + ->setMethods(array('getSubClients')) |
|
346 | 346 | ->getMock(); |
347 | 347 | |
348 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
349 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
348 | + $object->expects($this->once())->method('getSubClients') |
|
349 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
350 | 350 | |
351 | - $object->setView( $this->getViewNoRender() ); |
|
351 | + $object->setView($this->getViewNoRender()); |
|
352 | 352 | |
353 | 353 | $object->search(); |
354 | 354 | } |
@@ -356,48 +356,48 @@ discard block |
||
356 | 356 | |
357 | 357 | public function testGetSubClient() |
358 | 358 | { |
359 | - $result = $this->object->getSubClient( 'image' ); |
|
360 | - $this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result ); |
|
359 | + $result = $this->object->getSubClient('image'); |
|
360 | + $this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
364 | 364 | public function testGetSubClientEmpty() |
365 | 365 | { |
366 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
367 | - $this->object->getSubClient( '' ); |
|
366 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
367 | + $this->object->getSubClient(''); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | |
371 | 371 | public function testGetSubClientInvalid() |
372 | 372 | { |
373 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
374 | - $this->object->getSubClient( 'invalid' ); |
|
373 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
374 | + $this->object->getSubClient('invalid'); |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | |
378 | 378 | public function testGetSubClientDecorators() |
379 | 379 | { |
380 | - $this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Cache' ) ); |
|
380 | + $this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Cache')); |
|
381 | 381 | |
382 | - $result = $this->object->getSubClient( 'image' ); |
|
383 | - $this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result ); |
|
382 | + $result = $this->object->getSubClient('image'); |
|
383 | + $this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
387 | 387 | public function testGetSubClientDecoratorInvalid() |
388 | 388 | { |
389 | - $this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Invalid' ) ); |
|
389 | + $this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Invalid')); |
|
390 | 390 | |
391 | - $this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' ); |
|
392 | - $this->object->getSubClient( 'image' ); |
|
391 | + $this->setExpectedException('\Aimeos\Admin\JQAdm\Exception'); |
|
392 | + $this->object->getSubClient('image'); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | |
396 | 396 | protected function getViewNoRender() |
397 | 397 | { |
398 | - return $this->getMockBuilder( '\Aimeos\MW\View\Standard' ) |
|
399 | - ->setConstructorArgs( array( array() ) ) |
|
400 | - ->setMethods( array( 'render', 'config' ) ) |
|
398 | + return $this->getMockBuilder('\Aimeos\MW\View\Standard') |
|
399 | + ->setConstructorArgs(array(array())) |
|
400 | + ->setMethods(array('render', 'config')) |
|
401 | 401 | ->getMock(); |
402 | 402 | } |
403 | 403 | } |
@@ -17,42 +17,42 @@ |
||
17 | 17 | { |
18 | 18 | $this->templatePaths = \TestHelperJqadm::getTemplatePaths(); |
19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
24 | 24 | public function testCreateClient() |
25 | 25 | { |
26 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths ); |
|
27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
26 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths); |
|
27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | public function testCreateClientName() |
32 | 32 | { |
33 | - $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, 'Standard' ); |
|
34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
33 | + $client = \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, 'Standard'); |
|
34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testCreateClientNameEmpty() |
39 | 39 | { |
40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
41 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, '' ); |
|
40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
41 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testCreateClientNameInvalid() |
46 | 46 | { |
47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
48 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, '%product' ); |
|
47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
48 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, '%product'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateClientNameNotFound() |
53 | 53 | { |
54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
55 | - \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, 'test' ); |
|
54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
55 | + \Aimeos\Admin\JQAdm\Product\Factory::createClient($this->context, $this->templatePaths, 'test'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | } |