@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/locale/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/locale/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/locale/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Locale\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'locale' ); |
|
82 | + return self::addClientDecorators($context, $client, 'locale'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/locale/language/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/locale/language/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/locale/language/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Language\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Language\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Locale\\Language\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'locale/language' ); |
|
82 | + return self::addClientDecorators($context, $client, 'locale/language'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/locale/currency/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/locale/currency/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/locale/currency/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Currency\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Currency\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Locale\\Currency\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'locale/currency' ); |
|
82 | + return self::addClientDecorators($context, $client, 'locale/currency'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return \Aimeos\Admin\JQAdm\Iface Filter part implementing \Aimeos\Admin\JQAdm\Iface |
30 | 30 | * @throws \Aimeos\Admin\JQAdm\Exception If requested client implementation couldn't be found or initialisation fails |
31 | 31 | */ |
32 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, $name = null ) |
|
32 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, $name = null) |
|
33 | 33 | { |
34 | 34 | /** admin/jqadm/locale/site/name |
35 | 35 | * Class name of the used account favorite client implementation |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | * @since 2017.10 |
65 | 65 | * @category Developer |
66 | 66 | */ |
67 | - if( $name === null ) { |
|
68 | - $name = $context->getConfig()->get( 'admin/jqadm/locale/site/name', 'Standard' ); |
|
67 | + if ($name === null) { |
|
68 | + $name = $context->getConfig()->get('admin/jqadm/locale/site/name', 'Standard'); |
|
69 | 69 | } |
70 | 70 | |
71 | - if( ctype_alnum( $name ) === false ) |
|
71 | + if (ctype_alnum($name) === false) |
|
72 | 72 | { |
73 | - $classname = is_string( $name ) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Site\\' . $name : '<not a string>'; |
|
74 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
73 | + $classname = is_string($name) ? '\\Aimeos\\Admin\\JQAdm\\Locale\\Site\\' . $name : '<not a string>'; |
|
74 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $iface = '\\Aimeos\\Admin\\JQAdm\\Iface'; |
78 | 78 | $classname = '\\Aimeos\\Admin\\JQAdm\\Locale\\Site\\' . $name; |
79 | 79 | |
80 | - $client = self::createClientBase( $context, $classname, $iface ); |
|
80 | + $client = self::createClientBase($context, $classname, $iface); |
|
81 | 81 | |
82 | - return self::addClientDecorators( $context, $client, 'locale/site' ); |
|
82 | + return self::addClientDecorators($context, $client, 'locale/site'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @param string $siteid ID of a site item |
40 | 40 | * @return string|null Label of the site item or null if not found |
41 | 41 | */ |
42 | - public function match( $siteid ); |
|
42 | + public function match($siteid); |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Returns "readonly" if the item is inherited from another site |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param string $siteid ID of a site item |
48 | 48 | * @return string|null "readonly" if item is from a parent site, null if not |
49 | 49 | */ |
50 | - public function readonly( $siteid ); |
|
50 | + public function readonly($siteid); |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Returns the site ID of the current site |
@@ -19,44 +19,44 @@ |
||
19 | 19 | |
20 | 20 | protected function setUp() |
21 | 21 | { |
22 | - $this->cache = $this->getMockBuilder( 'Aimeos\MW\Cache\None' ) |
|
23 | - ->setMethods( array( 'deleteByTags' ) ) |
|
22 | + $this->cache = $this->getMockBuilder('Aimeos\MW\Cache\None') |
|
23 | + ->setMethods(array('deleteByTags')) |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Category\Standard' ) |
|
28 | - ->setMethods( array( 'save' ) ) |
|
27 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Category\Standard') |
|
28 | + ->setMethods(array('save')) |
|
29 | 29 | ->disableOriginalConstructor() |
30 | 30 | ->getMock(); |
31 | 31 | |
32 | 32 | $this->context = \TestHelperJqadm::getContext(); |
33 | - $this->context->setCache( $this->cache ); |
|
33 | + $this->context->setCache($this->cache); |
|
34 | 34 | |
35 | - $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Decorator\Cache( $this->mock, $this->context ); |
|
35 | + $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Decorator\Cache($this->mock, $this->context); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | protected function tearDown() |
40 | 40 | { |
41 | - unset( $this->object, $this->mock, $this->context, $this->cache ); |
|
41 | + unset($this->object, $this->mock, $this->context, $this->cache); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testSave() |
46 | 46 | { |
47 | 47 | $view = \TestHelperJqadm::getView(); |
48 | - $tags = array( 'catalog', 'catalog-1', 'catalog-2' ); |
|
48 | + $tags = array('catalog', 'catalog-1', 'catalog-2'); |
|
49 | 49 | |
50 | 50 | $param = ['site' => 'unittest', 'category' => ['catalog.id' => ['1', '2']]]; |
51 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
52 | - $view->addHelper( 'param', $helper ); |
|
51 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
52 | + $view->addHelper('param', $helper); |
|
53 | 53 | |
54 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
55 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
54 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
55 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
56 | 56 | |
57 | - $this->object->setView( $view ); |
|
57 | + $this->object->setView($view); |
|
58 | 58 | $result = $this->object->save(); |
59 | 59 | |
60 | - $this->assertEquals( 'test', $result ); |
|
60 | + $this->assertEquals('test', $result); |
|
61 | 61 | } |
62 | 62 | } |
@@ -19,62 +19,62 @@ |
||
19 | 19 | |
20 | 20 | protected function setUp() |
21 | 21 | { |
22 | - $this->cache = $this->getMockBuilder( 'Aimeos\MW\Cache\None' ) |
|
23 | - ->setMethods( array( 'deleteByTags' ) ) |
|
22 | + $this->cache = $this->getMockBuilder('Aimeos\MW\Cache\None') |
|
23 | + ->setMethods(array('deleteByTags')) |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
28 | - ->setMethods( array( 'delete', 'save' ) ) |
|
27 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
28 | + ->setMethods(array('delete', 'save')) |
|
29 | 29 | ->disableOriginalConstructor() |
30 | 30 | ->getMock(); |
31 | 31 | |
32 | 32 | $this->context = \TestHelperJqadm::getContext(); |
33 | - $this->context->setCache( $this->cache ); |
|
33 | + $this->context->setCache($this->cache); |
|
34 | 34 | |
35 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache( $this->mock, $this->context ); |
|
36 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
37 | - $this->object->setView( \TestHelperJqadm::getView() ); |
|
35 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Cache($this->mock, $this->context); |
|
36 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
37 | + $this->object->setView(\TestHelperJqadm::getView()); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | protected function tearDown() |
42 | 42 | { |
43 | - unset( $this->object, $this->mock, $this->context, $this->cache ); |
|
43 | + unset($this->object, $this->mock, $this->context, $this->cache); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testDelete() |
48 | 48 | { |
49 | 49 | $view = \TestHelperJqadm::getView(); |
50 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => 1 ) ); |
|
51 | - $view->addHelper( 'param', $helper ); |
|
50 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => 1)); |
|
51 | + $view->addHelper('param', $helper); |
|
52 | 52 | |
53 | - $tags = array( 'product', 'product-1' ); |
|
54 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
55 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
53 | + $tags = array('product', 'product-1'); |
|
54 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
55 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
56 | 56 | |
57 | - $this->object->setView( $view ); |
|
57 | + $this->object->setView($view); |
|
58 | 58 | $result = $this->object->delete(); |
59 | 59 | |
60 | - $this->assertEquals( 'test', $result ); |
|
60 | + $this->assertEquals('test', $result); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testSave() |
65 | 65 | { |
66 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
66 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
67 | 67 | |
68 | - $tags = array( 'product', 'product-' . $item->getId() ); |
|
68 | + $tags = array('product', 'product-' . $item->getId()); |
|
69 | 69 | $view = \TestHelperJqadm::getView(); |
70 | 70 | $view->item = $item; |
71 | 71 | |
72 | - $this->cache->expects( $this->once() )->method( 'deleteByTags' )->with( $this->equalTo( $tags ) ); |
|
73 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
72 | + $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags)); |
|
73 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
74 | 74 | |
75 | - $this->object->setView( $view ); |
|
75 | + $this->object->setView($view); |
|
76 | 76 | $result = $this->object->save(); |
77 | 77 | |
78 | - $this->assertEquals( 'test', $result ); |
|
78 | + $this->assertEquals('test', $result); |
|
79 | 79 | } |
80 | 80 | } |
@@ -17,77 +17,77 @@ |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
21 | - ->setMethods( array( 'copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient' ) ) |
|
20 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
21 | + ->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient')) |
|
22 | 22 | ->disableOriginalConstructor() |
23 | 23 | ->getMock(); |
24 | 24 | |
25 | 25 | $context = \TestHelperJqadm::getContext(); |
26 | 26 | |
27 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->mock, $context ); |
|
28 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
29 | - $this->object->setView( \TestHelperJqadm::getView() ); |
|
27 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->mock, $context); |
|
28 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
29 | + $this->object->setView(\TestHelperJqadm::getView()); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | protected function tearDown() |
34 | 34 | { |
35 | - unset( $this->object, $this->mock ); |
|
35 | + unset($this->object, $this->mock); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testCopy() |
40 | 40 | { |
41 | - $this->mock->expects( $this->once() )->method( 'copy' )->will( $this->returnValue( 'test' ) ); |
|
41 | + $this->mock->expects($this->once())->method('copy')->will($this->returnValue('test')); |
|
42 | 42 | |
43 | - $this->assertEquals( 'test', $this->object->copy() ); |
|
43 | + $this->assertEquals('test', $this->object->copy()); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testCreate() |
48 | 48 | { |
49 | - $this->mock->expects( $this->once() )->method( 'create' )->will( $this->returnValue( 'test' ) ); |
|
49 | + $this->mock->expects($this->once())->method('create')->will($this->returnValue('test')); |
|
50 | 50 | |
51 | - $this->assertEquals( 'test', $this->object->create() ); |
|
51 | + $this->assertEquals('test', $this->object->create()); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testDelete() |
56 | 56 | { |
57 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
57 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
58 | 58 | |
59 | - $this->assertEquals( 'test', $this->object->delete() ); |
|
59 | + $this->assertEquals('test', $this->object->delete()); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testGet() |
64 | 64 | { |
65 | - $this->mock->expects( $this->once() )->method( 'get' )->will( $this->returnValue( 'test' ) ); |
|
65 | + $this->mock->expects($this->once())->method('get')->will($this->returnValue('test')); |
|
66 | 66 | |
67 | - $this->assertEquals( 'test', $this->object->get() ); |
|
67 | + $this->assertEquals('test', $this->object->get()); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testSave() |
72 | 72 | { |
73 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
73 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
74 | 74 | |
75 | - $this->assertEquals( 'test', $this->object->save() ); |
|
75 | + $this->assertEquals('test', $this->object->save()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | public function testSearch() |
80 | 80 | { |
81 | - $this->mock->expects( $this->once() )->method( 'search' )->will( $this->returnValue( 'test' ) ); |
|
81 | + $this->mock->expects($this->once())->method('search')->will($this->returnValue('test')); |
|
82 | 82 | |
83 | - $this->assertEquals( 'test', $this->object->search() ); |
|
83 | + $this->assertEquals('test', $this->object->search()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
87 | 87 | public function testGetSubClient() |
88 | 88 | { |
89 | - $this->mock->expects( $this->once() )->method( 'getSubClient' )->will( $this->returnValue( 'test' ) ); |
|
89 | + $this->mock->expects($this->once())->method('getSubClient')->will($this->returnValue('test')); |
|
90 | 90 | |
91 | - $this->assertEquals( 'test', $this->object->getSubClient( 'unknown' ) ); |
|
91 | + $this->assertEquals('test', $this->object->getSubClient('unknown')); |
|
92 | 92 | } |
93 | 93 | } |
@@ -20,48 +20,48 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperJqadm::getContext(); |
22 | 22 | |
23 | - $this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' ) |
|
24 | - ->setMethods( array( 'delete', 'save' ) ) |
|
23 | + $this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard') |
|
24 | + ->setMethods(array('delete', 'save')) |
|
25 | 25 | ->disableOriginalConstructor() |
26 | 26 | ->getMock(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index( $this->mock, $this->context ); |
|
29 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
30 | - $this->object->setView( \TestHelperJqadm::getView() ); |
|
28 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Index($this->mock, $this->context); |
|
29 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
30 | + $this->object->setView(\TestHelperJqadm::getView()); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | protected function tearDown() |
35 | 35 | { |
36 | - unset( $this->object, $this->mock, $this->context ); |
|
36 | + unset($this->object, $this->mock, $this->context); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testDelete() |
41 | 41 | { |
42 | 42 | $view = \TestHelperJqadm::getView(); |
43 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'id' => -1 ) ); |
|
44 | - $view->addHelper( 'param', $helper ); |
|
43 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('id' => -1)); |
|
44 | + $view->addHelper('param', $helper); |
|
45 | 45 | |
46 | - $this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) ); |
|
47 | - $this->object->setView( $view ); |
|
46 | + $this->mock->expects($this->once())->method('delete')->will($this->returnValue('test')); |
|
47 | + $this->object->setView($view); |
|
48 | 48 | |
49 | 49 | $result = $this->object->delete(); |
50 | 50 | |
51 | - $this->assertEquals( 'test', $result ); |
|
51 | + $this->assertEquals('test', $result); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testSave() |
56 | 56 | { |
57 | 57 | $view = \TestHelperJqadm::getView(); |
58 | - $view->item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
58 | + $view->item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
59 | 59 | |
60 | - $this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) ); |
|
61 | - $this->object->setView( $view ); |
|
60 | + $this->mock->expects($this->once())->method('save')->will($this->returnValue('test')); |
|
61 | + $this->object->setView($view); |
|
62 | 62 | |
63 | 63 | $result = $this->object->save(); |
64 | 64 | |
65 | - $this->assertEquals( 'test', $result ); |
|
65 | + $this->assertEquals('test', $result); |
|
66 | 66 | } |
67 | 67 | } |