Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/PageTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->context = \TestHelperJqadm::getContext();
21 21
 
22
-		$client = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context );
23
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $client, $this->context );
24
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
25
-		$this->object->setView( \TestHelperJqadm::getView() );
22
+		$client = new \Aimeos\Admin\JQAdm\Product\Standard($this->context);
23
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($client, $this->context);
24
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
25
+		$this->object->setView(\TestHelperJqadm::getView());
26 26
 	}
27 27
 
28 28
 
29 29
 	protected function tearDown()
30 30
 	{
31
-		unset( $this->object, $this->context );
31
+		unset($this->object, $this->context);
32 32
 	}
33 33
 
34 34
 
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	{
37 37
 		$view = \TestHelperJqadm::getView();
38 38
 
39
-		$this->object->setView( $view );
39
+		$this->object->setView($view);
40 40
 
41
-		$this->assertNull( $view->get( 'pageUser' ) );
42
-		$this->assertInternalType( 'array', $view->pageParams );
43
-		$this->assertInternalType( 'array', $view->pageI18nList );
44
-		$this->assertInternalType( 'array', $view->pageLangItems );
45
-		$this->assertInstanceOf( '\Aimeos\MShop\Locale\Item\Site\Iface', $view->pageSiteTree );
46
-		$this->assertInstanceOf( '\Aimeos\MShop\Locale\Item\Site\Iface', $view->pageSiteItem );
41
+		$this->assertNull($view->get('pageUser'));
42
+		$this->assertInternalType('array', $view->pageParams);
43
+		$this->assertInternalType('array', $view->pageI18nList);
44
+		$this->assertInternalType('array', $view->pageLangItems);
45
+		$this->assertInstanceOf('\Aimeos\MShop\Locale\Item\Site\Iface', $view->pageSiteTree);
46
+		$this->assertInstanceOf('\Aimeos\MShop\Locale\Item\Site\Iface', $view->pageSiteItem);
47 47
 	}
48 48
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/CacheTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -19,62 +19,62 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/BaseTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,77 +17,77 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/IndexTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,48 +20,48 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Dashboard/StandardTest.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Dashboard\Standard( $this->context );
29
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
30
-		$this->object->setView( $this->view );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Dashboard\Standard($this->context);
29
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
30
+		$this->object->setView($this->view);
31 31
 	}
32 32
 
33 33
 
34 34
 	protected function tearDown()
35 35
 	{
36
-		unset( $this->object, $this->view, $this->context );
36
+		unset($this->object, $this->view, $this->context);
37 37
 	}
38 38
 
39 39
 
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		$result = $this->object->search();
43 43
 
44
-		$this->assertContains( '<div class="dashboard">', $result );
44
+		$this->assertContains('<div class="dashboard">', $result);
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testSearchException()
49 49
 	{
50
-		$object = $this->getClientMock( 'getSubClients' );
50
+		$object = $this->getClientMock('getSubClients');
51 51
 
52
-		$object->expects( $this->once() )->method( 'getSubClients' )
53
-			->will( $this->throwException( new \RuntimeException() ) );
52
+		$object->expects($this->once())->method('getSubClients')
53
+			->will($this->throwException(new \RuntimeException()));
54 54
 
55 55
 		$object->search();
56 56
 	}
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testSearchMShopException()
60 60
 	{
61
-		$object = $this->getClientMock( 'getSubClients' );
61
+		$object = $this->getClientMock('getSubClients');
62 62
 
63
-		$object->expects( $this->once() )->method( 'getSubClients' )
64
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
63
+		$object->expects($this->once())->method('getSubClients')
64
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
65 65
 
66 66
 		$object->search();
67 67
 	}
@@ -69,20 +69,20 @@  discard block
 block discarded – undo
69 69
 
70 70
 	public function testGetSubClient()
71 71
 	{
72
-		$result = $this->object->getSubClient( 'order' );
73
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
72
+		$result = $this->object->getSubClient('order');
73
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
74 74
 	}
75 75
 
76 76
 
77
-	public function getClientMock( $method )
77
+	public function getClientMock($method)
78 78
 	{
79
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Dashboard\Standard' )
80
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
81
-			->setMethods( [$method] )
79
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Dashboard\Standard')
80
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
81
+			->setMethods([$method])
82 82
 			->getMock();
83 83
 
84
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
85
-		$object->setView( $this->getViewNoRender() );
84
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
85
+		$object->setView($this->getViewNoRender());
86 86
 
87 87
 		return $object;
88 88
 	}
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 
91 91
 	protected function getViewNoRender()
92 92
 	{
93
-		return $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
94
-			->setConstructorArgs( array( [] ) )
95
-			->setMethods( array( 'render', 'config' ) )
93
+		return $this->getMockBuilder('\Aimeos\MW\View\Standard')
94
+			->setConstructorArgs(array([]))
95
+			->setMethods(array('render', 'config'))
96 96
 			->getMock();
97 97
 	}
98 98
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Media/Lists/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
46
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
47
+			->setMethods(array('getSubClients'))
48 48
 			->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53
-		$object->setView( $this->getViewNoRender() );
53
+		$object->setView($this->getViewNoRender());
54 54
 
55 55
 		$object->create();
56 56
 	}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
62
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
63
+			->setMethods(array('getSubClients'))
64 64
 			->getMock();
65 65
 
66
-		$object->expects( $this->once() )->method( 'getSubClients' )
67
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
66
+		$object->expects($this->once())->method('getSubClients')
67
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
68 68
 
69
-		$object->setView( $this->getViewNoRender() );
69
+		$object->setView($this->getViewNoRender());
70 70
 
71 71
 		$object->create();
72 72
 	}
@@ -74,29 +74,29 @@  discard block
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/lists/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/lists/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
80
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
81
-		$this->view->addHelper( 'param', $helper );
79
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
80
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
81
+		$this->view->addHelper('param', $helper);
82 82
 
83 83
 		$result = $this->object->copy();
84 84
 
85
-		$this->assertContains( 'default', $result );
85
+		$this->assertContains('default', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('getSubClients'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \RuntimeException() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \RuntimeException()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
108
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
109
+			->setMethods(array('getSubClients'))
110 110
 			->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'getSubClients' )
113
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
112
+		$object->expects($this->once())->method('getSubClients')
113
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
114 114
 
115
-		$object->setView( $this->getViewNoRender() );
115
+		$object->setView($this->getViewNoRender());
116 116
 
117 117
 		$object->copy();
118 118
 	}
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDelete()
122 122
 	{
123
-		$this->assertNotNull( $this->object->delete() );
123
+		$this->assertNotNull($this->object->delete());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testDeleteException()
128 128
 	{
129
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
130
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
131
+			->setMethods(array('getSubClients', 'search'))
132 132
 			->getMock();
133 133
 
134
-		$object->expects( $this->once() )->method( 'getSubClients' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('getSubClients')
135
+			->will($this->throwException(new \RuntimeException()));
136 136
 
137
-		$object->setView( $this->getViewNoRender() );
137
+		$object->setView($this->getViewNoRender());
138 138
 
139 139
 		$object->delete();
140 140
 	}
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('getSubClients', 'search'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( $this->getViewNoRender() );
153
+		$object->setView($this->getViewNoRender());
154 154
 
155 155
 		$object->delete();
156 156
 	}
@@ -158,29 +158,29 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/lists/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/lists/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
164
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
165
-		$this->view->addHelper( 'param', $helper );
163
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
164
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
165
+		$this->view->addHelper('param', $helper);
166 166
 
167 167
 		$result = $this->object->get();
168 168
 
169
-		$this->assertContains( 'default', $result );
169
+		$this->assertContains('default', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
176
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
177
+			->setMethods(array('getSubClients'))
178 178
 			->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'getSubClients' )
181
-			->will( $this->throwException( new \RuntimeException() ) );
180
+		$object->expects($this->once())->method('getSubClients')
181
+			->will($this->throwException(new \RuntimeException()));
182 182
 
183
-		$object->setView( $this->getViewNoRender() );
183
+		$object->setView($this->getViewNoRender());
184 184
 
185 185
 		$object->get();
186 186
 	}
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
192
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
193
+			->setMethods(array('getSubClients'))
194 194
 			->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'getSubClients' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
196
+		$object->expects($this->once())->method('getSubClients')
197
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
198 198
 
199
-		$object->setView( $this->getViewNoRender() );
199
+		$object->setView($this->getViewNoRender());
200 200
 
201 201
 		$object->get();
202 202
 	}
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/lists/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/lists/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
 			),
227 227
 		);
228 228
 
229
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
230
-		$this->view->addHelper( 'param', $helper );
229
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
230
+		$this->view->addHelper('param', $helper);
231 231
 
232 232
 		$this->object->save();
233 233
 
234
-		$manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() );
234
+		$manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId());
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testSaveException()
239 239
 	{
240
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
241
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
242
+			->setMethods(array('fromArray'))
243 243
 			->getMock();
244 244
 
245
-		$object->expects( $this->once() )->method( 'fromArray' )
246
-			->will( $this->throwException( new \RuntimeException() ) );
245
+		$object->expects($this->once())->method('fromArray')
246
+			->will($this->throwException(new \RuntimeException()));
247 247
 
248
-		$object->setView( $this->getViewNoRender() );
248
+		$object->setView($this->getViewNoRender());
249 249
 
250 250
 		$object->save();
251 251
 	}
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
257
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
258
+			->setMethods(array('fromArray'))
259 259
 			->getMock();
260 260
 
261
-		$object->expects( $this->once() )->method( 'fromArray' )
262
-			->will( $this->throwException( new \RuntimeException() ) );
261
+		$object->expects($this->once())->method('fromArray')
262
+			->will($this->throwException(new \RuntimeException()));
263 263
 
264
-		$object->setView( $this->getViewNoRender() );
264
+		$object->setView($this->getViewNoRender());
265 265
 
266 266
 		$object->save();
267 267
 	}
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
273
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
274
+			->setMethods(array('fromArray'))
275 275
 			->getMock();
276 276
 
277
-		$object->expects( $this->once() )->method( 'fromArray' )
278
-			->will( $this->throwException( new \RuntimeException() ) );
277
+		$object->expects($this->once())->method('fromArray')
278
+			->will($this->throwException(new \RuntimeException()));
279 279
 
280
-		$object->setView( $this->getViewNoRender() );
280
+		$object->setView($this->getViewNoRender());
281 281
 
282 282
 		$object->save();
283 283
 	}
@@ -288,32 +288,32 @@  discard block
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'media.lists.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'default' ),
291
+				'key' => array(0 => 'media.lists.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'default'),
294 294
 			),
295
-			'sort' => array( '-media.lists.type.id' ),
295
+			'sort' => array('-media.lists.type.id'),
296 296
 		);
297
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
298
-		$this->view->addHelper( 'param', $helper );
297
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
298
+		$this->view->addHelper('param', $helper);
299 299
 
300 300
 		$result = $this->object->search();
301 301
 
302
-		$this->assertContains( '>default<', $result );
302
+		$this->assertContains('>default<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods(array('initCriteria'))
311 311
 			->getMock();
312 312
 
313
-		$object->expects( $this->once() )->method( 'initCriteria' )
314
-			->will( $this->throwException( new \RuntimeException() ) );
313
+		$object->expects($this->once())->method('initCriteria')
314
+			->will($this->throwException(new \RuntimeException()));
315 315
 
316
-		$object->setView( $this->getViewNoRender() );
316
+		$object->setView($this->getViewNoRender());
317 317
 
318 318
 		$object->search();
319 319
 	}
@@ -321,15 +321,15 @@  discard block
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard')
325
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
326
+			->setMethods(array('initCriteria'))
327 327
 			->getMock();
328 328
 
329
-		$object->expects( $this->once() )->method( 'initCriteria' )
330
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
329
+		$object->expects($this->once())->method('initCriteria')
330
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
331 331
 
332
-		$object->setView( $this->getViewNoRender() );
332
+		$object->setView($this->getViewNoRender());
333 333
 
334 334
 		$object->search();
335 335
 	}
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
341
+		$this->object->getSubClient('$unknown$');
342 342
 	}
343 343
 
344 344
 
345 345
 	public function testGetSubClientUnknown()
346 346
 	{
347
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
348
+		$this->object->getSubClient('unknown');
349 349
 	}
350 350
 
351 351
 
352 352
 	protected function getViewNoRender()
353 353
 	{
354
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/lists/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/lists/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
362
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
363
-		$view->addHelper( 'param', $helper );
361
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
362
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
363
+		$view->addHelper('param', $helper);
364 364
 
365
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
366
-		$view->addHelper( 'access', $helper );
365
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
366
+		$view->addHelper('access', $helper);
367 367
 
368 368
 		return $view;
369 369
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Media/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
46
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
47
+			->setMethods(array('getSubClients'))
48 48
 			->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53
-		$object->setView( $this->getViewNoRender() );
53
+		$object->setView($this->getViewNoRender());
54 54
 
55 55
 		$object->create();
56 56
 	}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
62
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
63
+			->setMethods(array('getSubClients'))
64 64
 			->getMock();
65 65
 
66
-		$object->expects( $this->once() )->method( 'getSubClients' )
67
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
66
+		$object->expects($this->once())->method('getSubClients')
67
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
68 68
 
69
-		$object->setView( $this->getViewNoRender() );
69
+		$object->setView($this->getViewNoRender());
70 70
 
71 71
 		$object->create();
72 72
 	}
@@ -74,29 +74,29 @@  discard block
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
80
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
81
-		$this->view->addHelper( 'param', $helper );
79
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
80
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
81
+		$this->view->addHelper('param', $helper);
82 82
 
83 83
 		$result = $this->object->copy();
84 84
 
85
-		$this->assertContains( 'default', $result );
85
+		$this->assertContains('default', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('getSubClients'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \RuntimeException() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \RuntimeException()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
108
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
109
+			->setMethods(array('getSubClients'))
110 110
 			->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'getSubClients' )
113
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
112
+		$object->expects($this->once())->method('getSubClients')
113
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
114 114
 
115
-		$object->setView( $this->getViewNoRender() );
115
+		$object->setView($this->getViewNoRender());
116 116
 
117 117
 		$object->copy();
118 118
 	}
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDelete()
122 122
 	{
123
-		$this->assertNotNull( $this->object->delete() );
123
+		$this->assertNotNull($this->object->delete());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testDeleteException()
128 128
 	{
129
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
130
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
131
+			->setMethods(array('getSubClients', 'search'))
132 132
 			->getMock();
133 133
 
134
-		$object->expects( $this->once() )->method( 'getSubClients' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('getSubClients')
135
+			->will($this->throwException(new \RuntimeException()));
136 136
 
137
-		$object->setView( $this->getViewNoRender() );
137
+		$object->setView($this->getViewNoRender());
138 138
 
139 139
 		$object->delete();
140 140
 	}
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('getSubClients', 'search'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( $this->getViewNoRender() );
153
+		$object->setView($this->getViewNoRender());
154 154
 
155 155
 		$object->delete();
156 156
 	}
@@ -158,29 +158,29 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
164
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
165
-		$this->view->addHelper( 'param', $helper );
163
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
164
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
165
+		$this->view->addHelper('param', $helper);
166 166
 
167 167
 		$result = $this->object->get();
168 168
 
169
-		$this->assertContains( 'default', $result );
169
+		$this->assertContains('default', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
176
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
177
+			->setMethods(array('getSubClients'))
178 178
 			->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'getSubClients' )
181
-			->will( $this->throwException( new \RuntimeException() ) );
180
+		$object->expects($this->once())->method('getSubClients')
181
+			->will($this->throwException(new \RuntimeException()));
182 182
 
183
-		$object->setView( $this->getViewNoRender() );
183
+		$object->setView($this->getViewNoRender());
184 184
 
185 185
 		$object->get();
186 186
 	}
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
192
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
193
+			->setMethods(array('getSubClients'))
194 194
 			->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'getSubClients' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
196
+		$object->expects($this->once())->method('getSubClients')
197
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
198 198
 
199
-		$object->setView( $this->getViewNoRender() );
199
+		$object->setView($this->getViewNoRender());
200 200
 
201 201
 		$object->get();
202 202
 	}
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Media\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
 			),
227 227
 		);
228 228
 
229
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
230
-		$this->view->addHelper( 'param', $helper );
229
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
230
+		$this->view->addHelper('param', $helper);
231 231
 
232 232
 		$this->object->save();
233 233
 
234
-		$manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() );
234
+		$manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId());
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testSaveException()
239 239
 	{
240
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
241
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
242
+			->setMethods(array('fromArray'))
243 243
 			->getMock();
244 244
 
245
-		$object->expects( $this->once() )->method( 'fromArray' )
246
-			->will( $this->throwException( new \RuntimeException() ) );
245
+		$object->expects($this->once())->method('fromArray')
246
+			->will($this->throwException(new \RuntimeException()));
247 247
 
248
-		$object->setView( $this->getViewNoRender() );
248
+		$object->setView($this->getViewNoRender());
249 249
 
250 250
 		$object->save();
251 251
 	}
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
257
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
258
+			->setMethods(array('fromArray'))
259 259
 			->getMock();
260 260
 
261
-		$object->expects( $this->once() )->method( 'fromArray' )
262
-			->will( $this->throwException( new \RuntimeException() ) );
261
+		$object->expects($this->once())->method('fromArray')
262
+			->will($this->throwException(new \RuntimeException()));
263 263
 
264
-		$object->setView( $this->getViewNoRender() );
264
+		$object->setView($this->getViewNoRender());
265 265
 
266 266
 		$object->save();
267 267
 	}
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
273
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
274
+			->setMethods(array('fromArray'))
275 275
 			->getMock();
276 276
 
277
-		$object->expects( $this->once() )->method( 'fromArray' )
278
-			->will( $this->throwException( new \RuntimeException() ) );
277
+		$object->expects($this->once())->method('fromArray')
278
+			->will($this->throwException(new \RuntimeException()));
279 279
 
280
-		$object->setView( $this->getViewNoRender() );
280
+		$object->setView($this->getViewNoRender());
281 281
 
282 282
 		$object->save();
283 283
 	}
@@ -288,32 +288,32 @@  discard block
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'media.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'default' ),
291
+				'key' => array(0 => 'media.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'default'),
294 294
 			),
295
-			'sort' => array( '-media.type.id' ),
295
+			'sort' => array('-media.type.id'),
296 296
 		);
297
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
298
-		$this->view->addHelper( 'param', $helper );
297
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
298
+		$this->view->addHelper('param', $helper);
299 299
 
300 300
 		$result = $this->object->search();
301 301
 
302
-		$this->assertContains( '>default<', $result );
302
+		$this->assertContains('>default<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods(array('initCriteria'))
311 311
 			->getMock();
312 312
 
313
-		$object->expects( $this->once() )->method( 'initCriteria' )
314
-			->will( $this->throwException( new \RuntimeException() ) );
313
+		$object->expects($this->once())->method('initCriteria')
314
+			->will($this->throwException(new \RuntimeException()));
315 315
 
316
-		$object->setView( $this->getViewNoRender() );
316
+		$object->setView($this->getViewNoRender());
317 317
 
318 318
 		$object->search();
319 319
 	}
@@ -321,15 +321,15 @@  discard block
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Media\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Media\Standard')
325
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
326
+			->setMethods(array('initCriteria'))
327 327
 			->getMock();
328 328
 
329
-		$object->expects( $this->once() )->method( 'initCriteria' )
330
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
329
+		$object->expects($this->once())->method('initCriteria')
330
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
331 331
 
332
-		$object->setView( $this->getViewNoRender() );
332
+		$object->setView($this->getViewNoRender());
333 333
 
334 334
 		$object->search();
335 335
 	}
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
341
+		$this->object->getSubClient('$unknown$');
342 342
 	}
343 343
 
344 344
 
345 345
 	public function testGetSubClientUnknown()
346 346
 	{
347
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
348
+		$this->object->getSubClient('unknown');
349 349
 	}
350 350
 
351 351
 
352 352
 	protected function getViewNoRender()
353 353
 	{
354
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'media/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'media/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
362
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
363
-		$view->addHelper( 'param', $helper );
361
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
362
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
363
+		$view->addHelper('param', $helper);
364 364
 
365
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
366
-		$view->addHelper( 'access', $helper );
365
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
366
+		$view->addHelper('access', $helper);
367 367
 
368 368
 		return $view;
369 369
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Attribute/Lists/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
46
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
47
+			->setMethods(array('getSubClients'))
48 48
 			->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53
-		$object->setView( $this->getViewNoRender() );
53
+		$object->setView($this->getViewNoRender());
54 54
 
55 55
 		$object->create();
56 56
 	}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
62
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
63
+			->setMethods(array('getSubClients'))
64 64
 			->getMock();
65 65
 
66
-		$object->expects( $this->once() )->method( 'getSubClients' )
67
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
66
+		$object->expects($this->once())->method('getSubClients')
67
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
68 68
 
69
-		$object->setView( $this->getViewNoRender() );
69
+		$object->setView($this->getViewNoRender());
70 70
 
71 71
 		$object->create();
72 72
 	}
@@ -74,29 +74,29 @@  discard block
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/lists/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/lists/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
80
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
81
-		$this->view->addHelper( 'param', $helper );
79
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
80
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
81
+		$this->view->addHelper('param', $helper);
82 82
 
83 83
 		$result = $this->object->copy();
84 84
 
85
-		$this->assertContains( 'default', $result );
85
+		$this->assertContains('default', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('getSubClients'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \RuntimeException() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \RuntimeException()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
108
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
109
+			->setMethods(array('getSubClients'))
110 110
 			->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'getSubClients' )
113
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
112
+		$object->expects($this->once())->method('getSubClients')
113
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
114 114
 
115
-		$object->setView( $this->getViewNoRender() );
115
+		$object->setView($this->getViewNoRender());
116 116
 
117 117
 		$object->copy();
118 118
 	}
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDelete()
122 122
 	{
123
-		$this->assertNotNull( $this->object->delete() );
123
+		$this->assertNotNull($this->object->delete());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testDeleteException()
128 128
 	{
129
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
130
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
131
+			->setMethods(array('getSubClients', 'search'))
132 132
 			->getMock();
133 133
 
134
-		$object->expects( $this->once() )->method( 'getSubClients' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('getSubClients')
135
+			->will($this->throwException(new \RuntimeException()));
136 136
 
137
-		$object->setView( $this->getViewNoRender() );
137
+		$object->setView($this->getViewNoRender());
138 138
 
139 139
 		$object->delete();
140 140
 	}
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('getSubClients', 'search'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( $this->getViewNoRender() );
153
+		$object->setView($this->getViewNoRender());
154 154
 
155 155
 		$object->delete();
156 156
 	}
@@ -158,29 +158,29 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/lists/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/lists/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
164
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
165
-		$this->view->addHelper( 'param', $helper );
163
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
164
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
165
+		$this->view->addHelper('param', $helper);
166 166
 
167 167
 		$result = $this->object->get();
168 168
 
169
-		$this->assertContains( 'default', $result );
169
+		$this->assertContains('default', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
176
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
177
+			->setMethods(array('getSubClients'))
178 178
 			->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'getSubClients' )
181
-			->will( $this->throwException( new \RuntimeException() ) );
180
+		$object->expects($this->once())->method('getSubClients')
181
+			->will($this->throwException(new \RuntimeException()));
182 182
 
183
-		$object->setView( $this->getViewNoRender() );
183
+		$object->setView($this->getViewNoRender());
184 184
 
185 185
 		$object->get();
186 186
 	}
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
192
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
193
+			->setMethods(array('getSubClients'))
194 194
 			->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'getSubClients' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
196
+		$object->expects($this->once())->method('getSubClients')
197
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
198 198
 
199
-		$object->setView( $this->getViewNoRender() );
199
+		$object->setView($this->getViewNoRender());
200 200
 
201 201
 		$object->get();
202 202
 	}
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/lists/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/lists/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
 			),
227 227
 		);
228 228
 
229
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
230
-		$this->view->addHelper( 'param', $helper );
229
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
230
+		$this->view->addHelper('param', $helper);
231 231
 
232 232
 		$this->object->save();
233 233
 
234
-		$manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() );
234
+		$manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId());
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testSaveException()
239 239
 	{
240
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
241
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
242
+			->setMethods(array('fromArray'))
243 243
 			->getMock();
244 244
 
245
-		$object->expects( $this->once() )->method( 'fromArray' )
246
-			->will( $this->throwException( new \RuntimeException() ) );
245
+		$object->expects($this->once())->method('fromArray')
246
+			->will($this->throwException(new \RuntimeException()));
247 247
 
248
-		$object->setView( $this->getViewNoRender() );
248
+		$object->setView($this->getViewNoRender());
249 249
 
250 250
 		$object->save();
251 251
 	}
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
257
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
258
+			->setMethods(array('fromArray'))
259 259
 			->getMock();
260 260
 
261
-		$object->expects( $this->once() )->method( 'fromArray' )
262
-			->will( $this->throwException( new \RuntimeException() ) );
261
+		$object->expects($this->once())->method('fromArray')
262
+			->will($this->throwException(new \RuntimeException()));
263 263
 
264
-		$object->setView( $this->getViewNoRender() );
264
+		$object->setView($this->getViewNoRender());
265 265
 
266 266
 		$object->save();
267 267
 	}
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
273
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
274
+			->setMethods(array('fromArray'))
275 275
 			->getMock();
276 276
 
277
-		$object->expects( $this->once() )->method( 'fromArray' )
278
-			->will( $this->throwException( new \RuntimeException() ) );
277
+		$object->expects($this->once())->method('fromArray')
278
+			->will($this->throwException(new \RuntimeException()));
279 279
 
280
-		$object->setView( $this->getViewNoRender() );
280
+		$object->setView($this->getViewNoRender());
281 281
 
282 282
 		$object->save();
283 283
 	}
@@ -288,32 +288,32 @@  discard block
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'attribute.lists.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'default' ),
291
+				'key' => array(0 => 'attribute.lists.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'default'),
294 294
 			),
295
-			'sort' => array( '-attribute.lists.type.id' ),
295
+			'sort' => array('-attribute.lists.type.id'),
296 296
 		);
297
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
298
-		$this->view->addHelper( 'param', $helper );
297
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
298
+		$this->view->addHelper('param', $helper);
299 299
 
300 300
 		$result = $this->object->search();
301 301
 
302
-		$this->assertContains( '>default<', $result );
302
+		$this->assertContains('>default<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods(array('initCriteria'))
311 311
 			->getMock();
312 312
 
313
-		$object->expects( $this->once() )->method( 'initCriteria' )
314
-			->will( $this->throwException( new \RuntimeException() ) );
313
+		$object->expects($this->once())->method('initCriteria')
314
+			->will($this->throwException(new \RuntimeException()));
315 315
 
316
-		$object->setView( $this->getViewNoRender() );
316
+		$object->setView($this->getViewNoRender());
317 317
 
318 318
 		$object->search();
319 319
 	}
@@ -321,15 +321,15 @@  discard block
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Lists\Standard')
325
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
326
+			->setMethods(array('initCriteria'))
327 327
 			->getMock();
328 328
 
329
-		$object->expects( $this->once() )->method( 'initCriteria' )
330
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
329
+		$object->expects($this->once())->method('initCriteria')
330
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
331 331
 
332
-		$object->setView( $this->getViewNoRender() );
332
+		$object->setView($this->getViewNoRender());
333 333
 
334 334
 		$object->search();
335 335
 	}
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
341
+		$this->object->getSubClient('$unknown$');
342 342
 	}
343 343
 
344 344
 
345 345
 	public function testGetSubClientUnknown()
346 346
 	{
347
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
348
+		$this->object->getSubClient('unknown');
349 349
 	}
350 350
 
351 351
 
352 352
 	protected function getViewNoRender()
353 353
 	{
354
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/lists/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/lists/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()];
362
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
363
-		$view->addHelper( 'param', $helper );
361
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()];
362
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
363
+		$view->addHelper('param', $helper);
364 364
 
365
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
366
-		$view->addHelper( 'access', $helper );
365
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
366
+		$view->addHelper('access', $helper);
367 367
 
368 368
 		return $view;
369 369
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Attribute/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Attribute\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Type\Attribute\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
46
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
47
+			->setMethods(array('getSubClients'))
48 48
 			->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53
-		$object->setView( $this->getViewNoRender() );
53
+		$object->setView($this->getViewNoRender());
54 54
 
55 55
 		$object->create();
56 56
 	}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
62
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
63
+			->setMethods(array('getSubClients'))
64 64
 			->getMock();
65 65
 
66
-		$object->expects( $this->once() )->method( 'getSubClients' )
67
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
66
+		$object->expects($this->once())->method('getSubClients')
67
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
68 68
 
69
-		$object->setView( $this->getViewNoRender() );
69
+		$object->setView($this->getViewNoRender());
70 70
 
71 71
 		$object->create();
72 72
 	}
@@ -74,29 +74,29 @@  discard block
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'color', [], 'product' )->getId()];
80
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
81
-		$this->view->addHelper( 'param', $helper );
79
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('color', [], 'product')->getId()];
80
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
81
+		$this->view->addHelper('param', $helper);
82 82
 
83 83
 		$result = $this->object->copy();
84 84
 
85
-		$this->assertContains( 'color', $result );
85
+		$this->assertContains('color', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('getSubClients'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \RuntimeException() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \RuntimeException()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
108
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
109
+			->setMethods(array('getSubClients'))
110 110
 			->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'getSubClients' )
113
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
112
+		$object->expects($this->once())->method('getSubClients')
113
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
114 114
 
115
-		$object->setView( $this->getViewNoRender() );
115
+		$object->setView($this->getViewNoRender());
116 116
 
117 117
 		$object->copy();
118 118
 	}
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDelete()
122 122
 	{
123
-		$this->assertNotNull( $this->object->delete() );
123
+		$this->assertNotNull($this->object->delete());
124 124
 	}
125 125
 
126 126
 
127 127
 	public function testDeleteException()
128 128
 	{
129
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
130
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
131
+			->setMethods(array('getSubClients', 'search'))
132 132
 			->getMock();
133 133
 
134
-		$object->expects( $this->once() )->method( 'getSubClients' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('getSubClients')
135
+			->will($this->throwException(new \RuntimeException()));
136 136
 
137
-		$object->setView( $this->getViewNoRender() );
137
+		$object->setView($this->getViewNoRender());
138 138
 
139 139
 		$object->delete();
140 140
 	}
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('getSubClients', 'search'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( $this->getViewNoRender() );
153
+		$object->setView($this->getViewNoRender());
154 154
 
155 155
 		$object->delete();
156 156
 	}
@@ -158,29 +158,29 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'color', [], 'product' )->getId()];
164
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
165
-		$this->view->addHelper( 'param', $helper );
163
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('color', [], 'product')->getId()];
164
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
165
+		$this->view->addHelper('param', $helper);
166 166
 
167 167
 		$result = $this->object->get();
168 168
 
169
-		$this->assertContains( 'color', $result );
169
+		$this->assertContains('color', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
176
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
177
+			->setMethods(array('getSubClients'))
178 178
 			->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'getSubClients' )
181
-			->will( $this->throwException( new \RuntimeException() ) );
180
+		$object->expects($this->once())->method('getSubClients')
181
+			->will($this->throwException(new \RuntimeException()));
182 182
 
183
-		$object->setView( $this->getViewNoRender() );
183
+		$object->setView($this->getViewNoRender());
184 184
 
185 185
 		$object->get();
186 186
 	}
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
192
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
193
+			->setMethods(array('getSubClients'))
194 194
 			->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'getSubClients' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
196
+		$object->expects($this->once())->method('getSubClients')
197
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
198 198
 
199
-		$object->setView( $this->getViewNoRender() );
199
+		$object->setView($this->getViewNoRender());
200 200
 
201 201
 		$object->get();
202 202
 	}
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Attribute\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Attribute\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
226 226
 			),
227 227
 		);
228 228
 
229
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
230
-		$this->view->addHelper( 'param', $helper );
229
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
230
+		$this->view->addHelper('param', $helper);
231 231
 
232 232
 		$this->object->save();
233 233
 
234
-		$manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() );
234
+		$manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId());
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testSaveException()
239 239
 	{
240
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
241
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
242
+			->setMethods(array('fromArray'))
243 243
 			->getMock();
244 244
 
245
-		$object->expects( $this->once() )->method( 'fromArray' )
246
-			->will( $this->throwException( new \RuntimeException() ) );
245
+		$object->expects($this->once())->method('fromArray')
246
+			->will($this->throwException(new \RuntimeException()));
247 247
 
248
-		$object->setView( $this->getViewNoRender() );
248
+		$object->setView($this->getViewNoRender());
249 249
 
250 250
 		$object->save();
251 251
 	}
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
257
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
258
+			->setMethods(array('fromArray'))
259 259
 			->getMock();
260 260
 
261
-		$object->expects( $this->once() )->method( 'fromArray' )
262
-			->will( $this->throwException( new \RuntimeException() ) );
261
+		$object->expects($this->once())->method('fromArray')
262
+			->will($this->throwException(new \RuntimeException()));
263 263
 
264
-		$object->setView( $this->getViewNoRender() );
264
+		$object->setView($this->getViewNoRender());
265 265
 
266 266
 		$object->save();
267 267
 	}
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
273
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
274
+			->setMethods(array('fromArray'))
275 275
 			->getMock();
276 276
 
277
-		$object->expects( $this->once() )->method( 'fromArray' )
278
-			->will( $this->throwException( new \RuntimeException() ) );
277
+		$object->expects($this->once())->method('fromArray')
278
+			->will($this->throwException(new \RuntimeException()));
279 279
 
280
-		$object->setView( $this->getViewNoRender() );
280
+		$object->setView($this->getViewNoRender());
281 281
 
282 282
 		$object->save();
283 283
 	}
@@ -288,32 +288,32 @@  discard block
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'attribute.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'color' ),
291
+				'key' => array(0 => 'attribute.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'color'),
294 294
 			),
295
-			'sort' => array( '-attribute.type.id' ),
295
+			'sort' => array('-attribute.type.id'),
296 296
 		);
297
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
298
-		$this->view->addHelper( 'param', $helper );
297
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
298
+		$this->view->addHelper('param', $helper);
299 299
 
300 300
 		$result = $this->object->search();
301 301
 
302
-		$this->assertContains( '>color<', $result );
302
+		$this->assertContains('>color<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods(array('initCriteria'))
311 311
 			->getMock();
312 312
 
313
-		$object->expects( $this->once() )->method( 'initCriteria' )
314
-			->will( $this->throwException( new \RuntimeException() ) );
313
+		$object->expects($this->once())->method('initCriteria')
314
+			->will($this->throwException(new \RuntimeException()));
315 315
 
316
-		$object->setView( $this->getViewNoRender() );
316
+		$object->setView($this->getViewNoRender());
317 317
 
318 318
 		$object->search();
319 319
 	}
@@ -321,15 +321,15 @@  discard block
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Attribute\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Attribute\Standard')
325
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
326
+			->setMethods(array('initCriteria'))
327 327
 			->getMock();
328 328
 
329
-		$object->expects( $this->once() )->method( 'initCriteria' )
330
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
329
+		$object->expects($this->once())->method('initCriteria')
330
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
331 331
 
332
-		$object->setView( $this->getViewNoRender() );
332
+		$object->setView($this->getViewNoRender());
333 333
 
334 334
 		$object->search();
335 335
 	}
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
341
+		$this->object->getSubClient('$unknown$');
342 342
 	}
343 343
 
344 344
 
345 345
 	public function testGetSubClientUnknown()
346 346
 	{
347
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
348
+		$this->object->getSubClient('unknown');
349 349
 	}
350 350
 
351 351
 
352 352
 	protected function getViewNoRender()
353 353
 	{
354
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'color', [], 'product' )->getId()];
362
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
363
-		$view->addHelper( 'param', $helper );
361
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('color', [], 'product')->getId()];
362
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
363
+		$view->addHelper('param', $helper);
364 364
 
365
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
366
-		$view->addHelper( 'access', $helper );
365
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
366
+		$view->addHelper('access', $helper);
367 367
 
368 368
 		return $view;
369 369
 	}
Please login to merge, or discard this patch.