@@ -19,77 +19,77 @@ discard block |
||
19 | 19 | $this->context = \TestHelperJadm::getContext(); |
20 | 20 | $config = $this->context->getConfig(); |
21 | 21 | |
22 | - $config->set( 'admin/jsonadm/common/decorators/default', array() ); |
|
23 | - $config->set( 'admin/jsonadm/decorators/global', array() ); |
|
24 | - $config->set( 'admin/jsonadm/decorators/local', array() ); |
|
22 | + $config->set('admin/jsonadm/common/decorators/default', array()); |
|
23 | + $config->set('admin/jsonadm/decorators/global', array()); |
|
24 | + $config->set('admin/jsonadm/decorators/local', array()); |
|
25 | 25 | |
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | 29 | public function testInjectClient() |
30 | 30 | { |
31 | - $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
32 | - \Aimeos\Admin\JsonAdm\Factory::injectClient( '\\Aimeos\\Admin\\JsonAdm\\Standard', $cntl ); |
|
31 | + $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
32 | + \Aimeos\Admin\JsonAdm\Factory::injectClient('\\Aimeos\\Admin\\JsonAdm\\Standard', $cntl); |
|
33 | 33 | |
34 | - $iCntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
34 | + $iCntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
35 | 35 | |
36 | - $this->assertSame( $cntl, $iCntl ); |
|
36 | + $this->assertSame($cntl, $iCntl); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testInjectClientReset() |
41 | 41 | { |
42 | - $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
43 | - \Aimeos\Admin\JsonAdm\Factory::injectClient( '\\Aimeos\\Admin\\JsonAdm\\Standard', $cntl ); |
|
44 | - \Aimeos\Admin\JsonAdm\Factory::injectClient( '\\Aimeos\\Admin\\JsonAdm\\Standard', null ); |
|
42 | + $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
43 | + \Aimeos\Admin\JsonAdm\Factory::injectClient('\\Aimeos\\Admin\\JsonAdm\\Standard', $cntl); |
|
44 | + \Aimeos\Admin\JsonAdm\Factory::injectClient('\\Aimeos\\Admin\\JsonAdm\\Standard', null); |
|
45 | 45 | |
46 | - $new = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
46 | + $new = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
47 | 47 | |
48 | - $this->assertNotSame( $cntl, $new ); |
|
48 | + $this->assertNotSame($cntl, $new); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testAddDecoratorsInvalidName() |
53 | 53 | { |
54 | - $decorators = array( '$' ); |
|
54 | + $decorators = array('$'); |
|
55 | 55 | $view = $this->context->getView(); |
56 | - $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
56 | + $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
57 | 57 | |
58 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
59 | - \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $cntl, $decorators, 'Test', $this->context, $view, array(), 'attribute' ); |
|
58 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
59 | + \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic($cntl, $decorators, 'Test', $this->context, $view, array(), 'attribute'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testAddDecoratorsInvalidClass() |
64 | 64 | { |
65 | - $decorators = array( 'Test' ); |
|
65 | + $decorators = array('Test'); |
|
66 | 66 | $view = $this->context->getView(); |
67 | - $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
67 | + $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
68 | 68 | |
69 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
70 | - \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $cntl, $decorators, 'TestDecorator', $this->context, $view, array(), 'attribute' ); |
|
69 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
70 | + \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic($cntl, $decorators, 'TestDecorator', $this->context, $view, array(), 'attribute'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | 74 | public function testAddDecoratorsInvalidInterface() |
75 | 75 | { |
76 | - $decorators = array( 'Test' ); |
|
76 | + $decorators = array('Test'); |
|
77 | 77 | $view = $this->context->getView(); |
78 | - $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
78 | + $cntl = \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
79 | 79 | |
80 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
81 | - \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic( $cntl, $decorators, |
|
82 | - '\\Aimeos\\Admin\\Jsonadm\\Common\\Decorator\\', $this->context, $view, array(), 'attribute' ); |
|
80 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
81 | + \Aimeos\Admin\JsonAdm\Common\Factory\TestAbstract::addDecoratorsPublic($cntl, $decorators, |
|
82 | + '\\Aimeos\\Admin\\Jsonadm\\Common\\Decorator\\', $this->context, $view, array(), 'attribute'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | 86 | public function testAddClientDecoratorsExcludes() |
87 | 87 | { |
88 | - $this->context->getConfig()->set( 'admin/jsonadm/decorators/excludes', array( 'TestDecorator' ) ); |
|
89 | - $this->context->getConfig()->set( 'admin/jsonadm/common/decorators/default', array( 'TestDecorator' ) ); |
|
88 | + $this->context->getConfig()->set('admin/jsonadm/decorators/excludes', array('TestDecorator')); |
|
89 | + $this->context->getConfig()->set('admin/jsonadm/common/decorators/default', array('TestDecorator')); |
|
90 | 90 | |
91 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
92 | - \Aimeos\Admin\JsonAdm\Factory::createClient( $this->context, array(), 'attribute', 'Standard' ); |
|
91 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
92 | + \Aimeos\Admin\JsonAdm\Factory::createClient($this->context, array(), 'attribute', 'Standard'); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | * @param string $classprefix |
102 | 102 | * @param string $path |
103 | 103 | */ |
104 | - public static function addDecoratorsPublic( \Aimeos\Admin\JsonAdm\Iface $client, array $decorators, $classprefix, |
|
105 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, $templatePaths, $path ) |
|
104 | + public static function addDecoratorsPublic(\Aimeos\Admin\JsonAdm\Iface $client, array $decorators, $classprefix, |
|
105 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, $templatePaths, $path) |
|
106 | 106 | { |
107 | - self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path ); |
|
107 | + self::addDecorators($client, $decorators, $classprefix, $context, $view, $templatePaths, $path); |
|
108 | 108 | } |
109 | 109 | |
110 | - public static function addClientDecoratorsPublic( \Aimeos\Admin\JsonAdm\Iface $client, |
|
111 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, $templatePaths, $path ) |
|
110 | + public static function addClientDecoratorsPublic(\Aimeos\Admin\JsonAdm\Iface $client, |
|
111 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, $templatePaths, $path) |
|
112 | 112 | { |
113 | - self::addClientDecorators( $client, $context, $view, $templatePaths, $path ); |
|
113 | + self::addClientDecorators($client, $context, $view, $templatePaths, $path); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 |