Completed
Push — master ( d9c87d...d2fca1 )
by Aimeos
06:49
created
client/html/tests/Client/Html/Basket/Mini/StandardTest.php 1 patch
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -10,129 +10,129 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20 20
 
21
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
22
-		$this->object = new \Aimeos\Client\Html\Basket\Mini\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Basket\Mini\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$output = $this->object->getHeader();
36
-		$this->assertNotNull( $output );
37
-	}
33
+    public function testGetHeader()
34
+    {
35
+        $output = $this->object->getHeader();
36
+        $this->assertNotNull( $output );
37
+    }
38 38
 
39 39
 
40
-	public function testGetHeaderException()
41
-	{
42
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
43
-			->setConstructorArgs( array( $this->context, array() ) )
44
-			->setMethods( array( 'setViewParams' ) )
45
-			->getMock();
40
+    public function testGetHeaderException()
41
+    {
42
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
43
+            ->setConstructorArgs( array( $this->context, array() ) )
44
+            ->setMethods( array( 'setViewParams' ) )
45
+            ->getMock();
46 46
 
47
-		$object->expects( $this->once() )->method( 'setViewParams' )
48
-			->will( $this->throwException( new \Exception() ) );
47
+        $object->expects( $this->once() )->method( 'setViewParams' )
48
+            ->will( $this->throwException( new \Exception() ) );
49 49
 
50
-		$object->setView( \TestHelperHtml::getView() );
50
+        $object->setView( \TestHelperHtml::getView() );
51 51
 
52
-		$this->assertEquals( null, $object->getHeader() );
53
-	}
52
+        $this->assertEquals( null, $object->getHeader() );
53
+    }
54 54
 
55 55
 
56
-	public function testGetBody()
57
-	{
58
-		$output = $this->object->getBody();
59
-		$miniBasket = $this->object->getView()->miniBasket;
60
-		$this->assertTrue( $miniBasket instanceof \Aimeos\MShop\Order\Item\Base\Iface );
61
-		$this->assertStringStartsWith( '<section class="aimeos basket-mini">', $output );
62
-	}
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59
+        $miniBasket = $this->object->getView()->miniBasket;
60
+        $this->assertTrue( $miniBasket instanceof \Aimeos\MShop\Order\Item\Base\Iface );
61
+        $this->assertStringStartsWith( '<section class="aimeos basket-mini">', $output );
62
+    }
63 63
 
64 64
 
65
-	public function testGetBodyHtmlException()
66
-	{
67
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
68
-			->setConstructorArgs( array( $this->context, array() ) )
69
-			->setMethods( array( 'setViewParams' ) )
70
-			->getMock();
65
+    public function testGetBodyHtmlException()
66
+    {
67
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
68
+            ->setConstructorArgs( array( $this->context, array() ) )
69
+            ->setMethods( array( 'setViewParams' ) )
70
+            ->getMock();
71 71
 
72
-		$object->expects( $this->once() )->method( 'setViewParams' )
73
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
72
+        $object->expects( $this->once() )->method( 'setViewParams' )
73
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
74 74
 
75
-		$object->setView( \TestHelperHtml::getView() );
75
+        $object->setView( \TestHelperHtml::getView() );
76 76
 
77
-		$this->assertContains( 'test exception', $object->getBody() );
78
-	}
77
+        $this->assertContains( 'test exception', $object->getBody() );
78
+    }
79 79
 
80 80
 
81
-	public function testGetBodyFrontendException()
82
-	{
83
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
84
-			->setConstructorArgs( array( $this->context, array() ) )
85
-			->setMethods( array( 'setViewParams' ) )
86
-			->getMock();
81
+    public function testGetBodyFrontendException()
82
+    {
83
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
84
+            ->setConstructorArgs( array( $this->context, array() ) )
85
+            ->setMethods( array( 'setViewParams' ) )
86
+            ->getMock();
87 87
 
88
-		$object->expects( $this->once() )->method( 'setViewParams' )
89
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
88
+        $object->expects( $this->once() )->method( 'setViewParams' )
89
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
90 90
 
91
-		$object->setView( \TestHelperHtml::getView() );
91
+        $object->setView( \TestHelperHtml::getView() );
92 92
 
93
-		$this->assertContains( 'test exception', $object->getBody() );
94
-	}
93
+        $this->assertContains( 'test exception', $object->getBody() );
94
+    }
95 95
 
96 96
 
97
-	public function testGetBodyMShopException()
98
-	{
99
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
100
-			->setConstructorArgs( array( $this->context, array() ) )
101
-			->setMethods( array( 'setViewParams' ) )
102
-			->getMock();
97
+    public function testGetBodyMShopException()
98
+    {
99
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Mini\Standard' )
100
+            ->setConstructorArgs( array( $this->context, array() ) )
101
+            ->setMethods( array( 'setViewParams' ) )
102
+            ->getMock();
103 103
 
104
-		$object->expects( $this->once() )->method( 'setViewParams' )
105
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
104
+        $object->expects( $this->once() )->method( 'setViewParams' )
105
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
106 106
 
107
-		$object->setView( \TestHelperHtml::getView() );
107
+        $object->setView( \TestHelperHtml::getView() );
108 108
 
109
-		$this->assertContains( 'test exception', $object->getBody() );
110
-	}
109
+        $this->assertContains( 'test exception', $object->getBody() );
110
+    }
111 111
 
112 112
 
113
-	public function testGetSubClient()
114
-	{
115
-		$client = $this->object->getSubClient( 'main', 'Standard' );
116
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
117
-	}
113
+    public function testGetSubClient()
114
+    {
115
+        $client = $this->object->getSubClient( 'main', 'Standard' );
116
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
117
+    }
118 118
 
119 119
 
120
-	public function testGetSubClientInvalid()
121
-	{
122
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
123
-		$this->object->getSubClient( 'invalid', 'invalid' );
124
-	}
120
+    public function testGetSubClientInvalid()
121
+    {
122
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
123
+        $this->object->getSubClient( 'invalid', 'invalid' );
124
+    }
125 125
 
126 126
 
127
-	public function testGetSubClientInvalidName()
128
-	{
129
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
130
-		$this->object->getSubClient( '$$$', '$$$' );
131
-	}
127
+    public function testGetSubClientInvalidName()
128
+    {
129
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
130
+        $this->object->getSubClient( '$$$', '$$$' );
131
+    }
132 132
 
133 133
 
134
-	public function testProcess()
135
-	{
136
-		$this->object->process();
137
-	}
134
+    public function testProcess()
135
+    {
136
+        $this->object->process();
137
+    }
138 138
 }
139 139
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Basket/Related/StandardTest.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -9,122 +9,122 @@
 block discarded – undo
9 9
  */
10 10
 class StandardTest extends \PHPUnit_Framework_TestCase
11 11
 {
12
-	private $object;
13
-	private $context;
12
+    private $object;
13
+    private $context;
14 14
 
15 15
 
16
-	protected function setUp()
17
-	{
18
-		$this->context = \TestHelperHtml::getContext();
16
+    protected function setUp()
17
+    {
18
+        $this->context = \TestHelperHtml::getContext();
19 19
 
20
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
21
-		$this->object = new \Aimeos\Client\Html\Basket\Related\Standard( $this->context, $paths );
22
-		$this->object->setView( \TestHelperHtml::getView() );
23
-	}
20
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
21
+        $this->object = new \Aimeos\Client\Html\Basket\Related\Standard( $this->context, $paths );
22
+        $this->object->setView( \TestHelperHtml::getView() );
23
+    }
24 24
 
25 25
 
26
-	protected function tearDown()
27
-	{
28
-		\Aimeos\Controller\Frontend\Basket\Factory::createController( $this->context )->clear();
29
-		unset( $this->object );
30
-	}
26
+    protected function tearDown()
27
+    {
28
+        \Aimeos\Controller\Frontend\Basket\Factory::createController( $this->context )->clear();
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$output = $this->object->getHeader();
36
-		$this->assertNotNull( $output );
37
-	}
33
+    public function testGetHeader()
34
+    {
35
+        $output = $this->object->getHeader();
36
+        $this->assertNotNull( $output );
37
+    }
38 38
 
39 39
 
40
-	public function testGetHeaderException()
41
-	{
42
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
43
-			->setConstructorArgs( array( $this->context, array() ) )
44
-			->setMethods( array( 'setViewParams' ) )
45
-			->getMock();
40
+    public function testGetHeaderException()
41
+    {
42
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
43
+            ->setConstructorArgs( array( $this->context, array() ) )
44
+            ->setMethods( array( 'setViewParams' ) )
45
+            ->getMock();
46 46
 
47
-		$object->expects( $this->once() )->method( 'setViewParams' )
48
-			->will( $this->throwException( new \Exception() ) );
47
+        $object->expects( $this->once() )->method( 'setViewParams' )
48
+            ->will( $this->throwException( new \Exception() ) );
49 49
 
50
-		$object->setView( \TestHelperHtml::getView() );
50
+        $object->setView( \TestHelperHtml::getView() );
51 51
 
52
-		$this->assertEquals( null, $object->getHeader() );
53
-	}
52
+        $this->assertEquals( null, $object->getHeader() );
53
+    }
54 54
 
55 55
 
56
-	public function testGetBody()
57
-	{
58
-		$output = $this->object->getBody();
59
-		$this->assertStringStartsWith( '<section class="aimeos basket-related">', $output );
60
-	}
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59
+        $this->assertStringStartsWith( '<section class="aimeos basket-related">', $output );
60
+    }
61 61
 
62 62
 
63
-	public function testGetBodyHtmlException()
64
-	{
65
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
66
-			->setConstructorArgs( array( $this->context, array() ) )
67
-			->setMethods( array( 'setViewParams' ) )
68
-			->getMock();
63
+    public function testGetBodyHtmlException()
64
+    {
65
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
66
+            ->setConstructorArgs( array( $this->context, array() ) )
67
+            ->setMethods( array( 'setViewParams' ) )
68
+            ->getMock();
69 69
 
70
-		$object->expects( $this->once() )->method( 'setViewParams' )
71
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
70
+        $object->expects( $this->once() )->method( 'setViewParams' )
71
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
72 72
 
73
-		$object->setView( \TestHelperHtml::getView() );
73
+        $object->setView( \TestHelperHtml::getView() );
74 74
 
75
-		$this->assertContains( 'test exception', $object->getBody() );
76
-	}
75
+        $this->assertContains( 'test exception', $object->getBody() );
76
+    }
77 77
 
78 78
 
79
-	public function testGetBodyFrontendException()
80
-	{
81
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
82
-			->setConstructorArgs( array( $this->context, array() ) )
83
-			->setMethods( array( 'setViewParams' ) )
84
-			->getMock();
79
+    public function testGetBodyFrontendException()
80
+    {
81
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
82
+            ->setConstructorArgs( array( $this->context, array() ) )
83
+            ->setMethods( array( 'setViewParams' ) )
84
+            ->getMock();
85 85
 
86
-		$object->expects( $this->once() )->method( 'setViewParams' )
87
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
86
+        $object->expects( $this->once() )->method( 'setViewParams' )
87
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
88 88
 
89
-		$object->setView( \TestHelperHtml::getView() );
89
+        $object->setView( \TestHelperHtml::getView() );
90 90
 
91
-		$this->assertContains( 'test exception', $object->getBody() );
92
-	}
91
+        $this->assertContains( 'test exception', $object->getBody() );
92
+    }
93 93
 
94 94
 
95
-	public function testGetBodyMShopException()
96
-	{
97
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
98
-			->setConstructorArgs( array( $this->context, array() ) )
99
-			->setMethods( array( 'setViewParams' ) )
100
-			->getMock();
95
+    public function testGetBodyMShopException()
96
+    {
97
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Basket\Related\Standard' )
98
+            ->setConstructorArgs( array( $this->context, array() ) )
99
+            ->setMethods( array( 'setViewParams' ) )
100
+            ->getMock();
101 101
 
102
-		$object->expects( $this->once() )->method( 'setViewParams' )
103
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
102
+        $object->expects( $this->once() )->method( 'setViewParams' )
103
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
104 104
 
105
-		$object->setView( \TestHelperHtml::getView() );
105
+        $object->setView( \TestHelperHtml::getView() );
106 106
 
107
-		$this->assertContains( 'test exception', $object->getBody() );
108
-	}
107
+        $this->assertContains( 'test exception', $object->getBody() );
108
+    }
109 109
 
110 110
 
111
-	public function testGetSubClient()
112
-	{
113
-		$client = $this->object->getSubClient( 'bought', 'Standard' );
114
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
115
-	}
111
+    public function testGetSubClient()
112
+    {
113
+        $client = $this->object->getSubClient( 'bought', 'Standard' );
114
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
115
+    }
116 116
 
117 117
 
118
-	public function testGetSubClientInvalid()
119
-	{
120
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
121
-		$this->object->getSubClient( 'invalid', 'invalid' );
122
-	}
118
+    public function testGetSubClientInvalid()
119
+    {
120
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
121
+        $this->object->getSubClient( 'invalid', 'invalid' );
122
+    }
123 123
 
124 124
 
125
-	public function testGetSubClientInvalidName()
126
-	{
127
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
128
-		$this->object->getSubClient( '$$$', '$$$' );
129
-	}
125
+    public function testGetSubClientInvalidName()
126
+    {
127
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
128
+        $this->object->getSubClient( '$$$', '$$$' );
129
+    }
130 130
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Locale/Select/StandardTest.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -10,153 +10,153 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $context;
14
-	private $object;
13
+    private $context;
14
+    private $object;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
20
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
21 21
 
22
-		$this->object = new \Aimeos\Client\Html\Locale\Select\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
22
+        $this->object = new \Aimeos\Client\Html\Locale\Select\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$tags = array();
36
-		$expire = null;
37
-		$output = $this->object->getHeader( 1, $tags, $expire );
33
+    public function testGetHeader()
34
+    {
35
+        $tags = array();
36
+        $expire = null;
37
+        $output = $this->object->getHeader( 1, $tags, $expire );
38 38
 
39
-		$this->assertNotNull( $output );
40
-		$this->assertEquals( null, $expire );
41
-		$this->assertEquals( 0, count( $tags ) );
42
-	}
39
+        $this->assertNotNull( $output );
40
+        $this->assertEquals( null, $expire );
41
+        $this->assertEquals( 0, count( $tags ) );
42
+    }
43 43
 
44 44
 
45
-	public function testGetHeaderException()
46
-	{
47
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
48
-			->setConstructorArgs( array( $this->context, array() ) )
49
-			->setMethods( array( 'setViewParams' ) )
50
-			->getMock();
45
+    public function testGetHeaderException()
46
+    {
47
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
48
+            ->setConstructorArgs( array( $this->context, array() ) )
49
+            ->setMethods( array( 'setViewParams' ) )
50
+            ->getMock();
51 51
 
52
-		$object->expects( $this->once() )->method( 'setViewParams' )
53
-			->will( $this->throwException( new \Exception() ) );
52
+        $object->expects( $this->once() )->method( 'setViewParams' )
53
+            ->will( $this->throwException( new \Exception() ) );
54 54
 
55
-		$object->setView( \TestHelperHtml::getView() );
55
+        $object->setView( \TestHelperHtml::getView() );
56 56
 
57
-		$this->assertEquals( null, $object->getHeader() );
58
-	}
57
+        $this->assertEquals( null, $object->getHeader() );
58
+    }
59 59
 
60 60
 
61
-	public function testGetBody()
62
-	{
63
-		$view = $this->object->getView();
64
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
65
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
66
-		$view->addHelper( 'request', $helper );
61
+    public function testGetBody()
62
+    {
63
+        $view = $this->object->getView();
64
+        $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
65
+        $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
66
+        $view->addHelper( 'request', $helper );
67 67
 
68
-		$tags = array();
69
-		$expire = null;
70
-		$output = $this->object->getBody( 1, $tags, $expire );
68
+        $tags = array();
69
+        $expire = null;
70
+        $output = $this->object->getBody( 1, $tags, $expire );
71 71
 
72
-		$this->assertStringStartsWith( '<section class="aimeos locale-select">', $output );
73
-		$this->assertEquals( null, $expire );
74
-		$this->assertEquals( 0, count( $tags ) );
75
-	}
72
+        $this->assertStringStartsWith( '<section class="aimeos locale-select">', $output );
73
+        $this->assertEquals( null, $expire );
74
+        $this->assertEquals( 0, count( $tags ) );
75
+    }
76 76
 
77 77
 
78
-	public function testGetBodyHtmlException()
79
-	{
80
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
81
-			->setConstructorArgs( array( $this->context, array() ) )
82
-			->setMethods( array( 'setViewParams' ) )
83
-			->getMock();
78
+    public function testGetBodyHtmlException()
79
+    {
80
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
81
+            ->setConstructorArgs( array( $this->context, array() ) )
82
+            ->setMethods( array( 'setViewParams' ) )
83
+            ->getMock();
84 84
 
85
-		$object->expects( $this->once() )->method( 'setViewParams' )
86
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
85
+        $object->expects( $this->once() )->method( 'setViewParams' )
86
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
87 87
 
88
-		$object->setView( \TestHelperHtml::getView() );
88
+        $object->setView( \TestHelperHtml::getView() );
89 89
 
90
-		$this->assertContains( 'test exception', $object->getBody() );
91
-	}
90
+        $this->assertContains( 'test exception', $object->getBody() );
91
+    }
92 92
 
93 93
 
94
-	public function testGetBodyFrontendException()
95
-	{
96
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
97
-			->setConstructorArgs( array( $this->context, array() ) )
98
-			->setMethods( array( 'setViewParams' ) )
99
-			->getMock();
94
+    public function testGetBodyFrontendException()
95
+    {
96
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
97
+            ->setConstructorArgs( array( $this->context, array() ) )
98
+            ->setMethods( array( 'setViewParams' ) )
99
+            ->getMock();
100 100
 
101
-		$object->expects( $this->once() )->method( 'setViewParams' )
102
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
101
+        $object->expects( $this->once() )->method( 'setViewParams' )
102
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
103 103
 
104
-		$object->setView( \TestHelperHtml::getView() );
104
+        $object->setView( \TestHelperHtml::getView() );
105 105
 
106
-		$this->assertContains( 'test exception', $object->getBody() );
107
-	}
106
+        $this->assertContains( 'test exception', $object->getBody() );
107
+    }
108 108
 
109 109
 
110
-	public function testGetBodyMShopException()
111
-	{
112
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
113
-			->setConstructorArgs( array( $this->context, array() ) )
114
-			->setMethods( array( 'setViewParams' ) )
115
-			->getMock();
110
+    public function testGetBodyMShopException()
111
+    {
112
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
113
+            ->setConstructorArgs( array( $this->context, array() ) )
114
+            ->setMethods( array( 'setViewParams' ) )
115
+            ->getMock();
116 116
 
117
-		$object->expects( $this->once() )->method( 'setViewParams' )
118
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
117
+        $object->expects( $this->once() )->method( 'setViewParams' )
118
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
119 119
 
120
-		$object->setView( \TestHelperHtml::getView() );
120
+        $object->setView( \TestHelperHtml::getView() );
121 121
 
122
-		$this->assertContains( 'test exception', $object->getBody() );
123
-	}
122
+        $this->assertContains( 'test exception', $object->getBody() );
123
+    }
124 124
 
125 125
 
126
-	public function testGetBodyException()
127
-	{
128
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
129
-			->setConstructorArgs( array( $this->context, array() ) )
130
-			->setMethods( array( 'setViewParams' ) )
131
-			->getMock();
126
+    public function testGetBodyException()
127
+    {
128
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Locale\Select\Standard' )
129
+            ->setConstructorArgs( array( $this->context, array() ) )
130
+            ->setMethods( array( 'setViewParams' ) )
131
+            ->getMock();
132 132
 
133
-		$object->expects( $this->once() )->method( 'setViewParams' )
134
-			->will( $this->throwException( new \Exception() ) );
133
+        $object->expects( $this->once() )->method( 'setViewParams' )
134
+            ->will( $this->throwException( new \Exception() ) );
135 135
 
136
-		$object->setView( \TestHelperHtml::getView() );
136
+        $object->setView( \TestHelperHtml::getView() );
137 137
 
138
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
139
-	}
138
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
139
+    }
140 140
 
141 141
 
142
-	public function testGetSubClient()
143
-	{
144
-		$client = $this->object->getSubClient( 'language', 'Standard' );
145
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
146
-	}
142
+    public function testGetSubClient()
143
+    {
144
+        $client = $this->object->getSubClient( 'language', 'Standard' );
145
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
146
+    }
147 147
 
148 148
 
149
-	public function testGetSubClientInvalid()
150
-	{
151
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
152
-		$this->object->getSubClient( 'invalid', 'invalid' );
153
-	}
149
+    public function testGetSubClientInvalid()
150
+    {
151
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
152
+        $this->object->getSubClient( 'invalid', 'invalid' );
153
+    }
154 154
 
155 155
 
156
-	public function testGetSubClientInvalidName()
157
-	{
158
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
159
-		$this->object->getSubClient( '$$$', '$$$' );
160
-	}
156
+    public function testGetSubClientInvalidName()
157
+    {
158
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
159
+        $this->object->getSubClient( '$$$', '$$$' );
160
+    }
161 161
 
162 162
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Stage/StandardTest.php 1 patch
Indentation   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -10,196 +10,196 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	/**
18
-	 * Sets up the fixture, for example, opens a network connection.
19
-	 * This method is called before a test is executed.
20
-	 *
21
-	 * @access protected
22
-	 */
23
-	protected function setUp()
24
-	{
25
-		$this->context = \TestHelperHtml::getContext();
17
+    /**
18
+     * Sets up the fixture, for example, opens a network connection.
19
+     * This method is called before a test is executed.
20
+     *
21
+     * @access protected
22
+     */
23
+    protected function setUp()
24
+    {
25
+        $this->context = \TestHelperHtml::getContext();
26 26
 
27
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
28
-		$this->object = new \Aimeos\Client\Html\Catalog\Stage\Standard( $this->context, $paths );
29
-		$this->object->setView( \TestHelperHtml::getView() );
30
-	}
27
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
28
+        $this->object = new \Aimeos\Client\Html\Catalog\Stage\Standard( $this->context, $paths );
29
+        $this->object->setView( \TestHelperHtml::getView() );
30
+    }
31 31
 
32 32
 
33
-	/**
34
-	 * Tears down the fixture, for example, closes a network connection.
35
-	 * This method is called after a test is executed.
36
-	 *
37
-	 * @access protected
38
-	 */
39
-	protected function tearDown()
40
-	{
41
-		unset( $this->object );
42
-	}
33
+    /**
34
+     * Tears down the fixture, for example, closes a network connection.
35
+     * This method is called after a test is executed.
36
+     *
37
+     * @access protected
38
+     */
39
+    protected function tearDown()
40
+    {
41
+        unset( $this->object );
42
+    }
43 43
 
44 44
 
45
-	public function testGetHeader()
46
-	{
47
-		$view = $this->object->getView();
48
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
49
-		$view->addHelper( 'param', $helper );
45
+    public function testGetHeader()
46
+    {
47
+        $view = $this->object->getView();
48
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
49
+        $view->addHelper( 'param', $helper );
50 50
 
51
-		$tags = array();
52
-		$expire = null;
53
-		$output = $this->object->getHeader( 1, $tags, $expire );
51
+        $tags = array();
52
+        $expire = null;
53
+        $output = $this->object->getHeader( 1, $tags, $expire );
54 54
 
55
-		$this->assertNotNull( $output );
56
-		$this->assertEquals( '2019-01-01 00:00:00', $expire );
57
-		$this->assertEquals( 1, count( $tags ) );
58
-	}
55
+        $this->assertNotNull( $output );
56
+        $this->assertEquals( '2019-01-01 00:00:00', $expire );
57
+        $this->assertEquals( 1, count( $tags ) );
58
+    }
59 59
 
60 60
 
61
-	public function testGetHeaderException()
62
-	{
63
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
64
-			->setConstructorArgs( array( $this->context, array() ) )
65
-			->setMethods( array( 'setViewParams' ) )
66
-			->getMock();
61
+    public function testGetHeaderException()
62
+    {
63
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
64
+            ->setConstructorArgs( array( $this->context, array() ) )
65
+            ->setMethods( array( 'setViewParams' ) )
66
+            ->getMock();
67 67
 
68
-		$object->expects( $this->once() )->method( 'setViewParams' )
69
-			->will( $this->throwException( new \Exception() ) );
68
+        $object->expects( $this->once() )->method( 'setViewParams' )
69
+            ->will( $this->throwException( new \Exception() ) );
70 70
 
71
-		$object->setView( \TestHelperHtml::getView() );
71
+        $object->setView( \TestHelperHtml::getView() );
72 72
 
73
-		$this->assertEquals( null, $object->getHeader() );
74
-	}
73
+        $this->assertEquals( null, $object->getHeader() );
74
+    }
75 75
 
76 76
 
77
-	public function testGetBody()
78
-	{
79
-		$tags = array();
80
-		$expire = null;
81
-		$output = $this->object->getBody( 1, $tags, $expire );
77
+    public function testGetBody()
78
+    {
79
+        $tags = array();
80
+        $expire = null;
81
+        $output = $this->object->getBody( 1, $tags, $expire );
82 82
 
83
-		$this->assertStringStartsWith( '<section class="aimeos catalog-stage">', $output );
84
-		$this->assertEquals( null, $expire );
85
-		$this->assertEquals( 0, count( $tags ) );
86
-	}
83
+        $this->assertStringStartsWith( '<section class="aimeos catalog-stage">', $output );
84
+        $this->assertEquals( null, $expire );
85
+        $this->assertEquals( 0, count( $tags ) );
86
+    }
87 87
 
88 88
 
89
-	public function testGetBodyCatId()
90
-	{
91
-		$view = $this->object->getView();
92
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
93
-		$view->addHelper( 'param', $helper );
89
+    public function testGetBodyCatId()
90
+    {
91
+        $view = $this->object->getView();
92
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
93
+        $view->addHelper( 'param', $helper );
94 94
 
95
-		$tags = array();
96
-		$expire = null;
97
-		$output = $this->object->getBody( 1, $tags, $expire );
95
+        $tags = array();
96
+        $expire = null;
97
+        $output = $this->object->getBody( 1, $tags, $expire );
98 98
 
99
-		$this->assertStringStartsWith( '<section class="aimeos catalog-stage home categories coffee">', $output );
100
-		$this->assertEquals( '2019-01-01 00:00:00', $expire );
101
-		$this->assertEquals( 1, count( $tags ) );
102
-	}
99
+        $this->assertStringStartsWith( '<section class="aimeos catalog-stage home categories coffee">', $output );
100
+        $this->assertEquals( '2019-01-01 00:00:00', $expire );
101
+        $this->assertEquals( 1, count( $tags ) );
102
+    }
103 103
 
104 104
 
105
-	public function testGetBodyHtmlException()
106
-	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
108
-			->setConstructorArgs( array( $this->context, array() ) )
109
-			->setMethods( array( 'setViewParams' ) )
110
-			->getMock();
105
+    public function testGetBodyHtmlException()
106
+    {
107
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
108
+            ->setConstructorArgs( array( $this->context, array() ) )
109
+            ->setMethods( array( 'setViewParams' ) )
110
+            ->getMock();
111 111
 
112
-		$object->expects( $this->once() )->method( 'setViewParams' )
113
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
112
+        $object->expects( $this->once() )->method( 'setViewParams' )
113
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
114 114
 
115
-		$object->setView( \TestHelperHtml::getView() );
115
+        $object->setView( \TestHelperHtml::getView() );
116 116
 
117
-		$this->assertContains( 'test exception', $object->getBody() );
118
-	}
117
+        $this->assertContains( 'test exception', $object->getBody() );
118
+    }
119 119
 
120 120
 
121
-	public function testGetBodyFrontendException()
122
-	{
123
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
124
-			->setConstructorArgs( array( $this->context, array() ) )
125
-			->setMethods( array( 'setViewParams' ) )
126
-			->getMock();
121
+    public function testGetBodyFrontendException()
122
+    {
123
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
124
+            ->setConstructorArgs( array( $this->context, array() ) )
125
+            ->setMethods( array( 'setViewParams' ) )
126
+            ->getMock();
127 127
 
128
-		$object->expects( $this->once() )->method( 'setViewParams' )
129
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
128
+        $object->expects( $this->once() )->method( 'setViewParams' )
129
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
130 130
 
131
-		$object->setView( \TestHelperHtml::getView() );
131
+        $object->setView( \TestHelperHtml::getView() );
132 132
 
133
-		$this->assertContains( 'test exception', $object->getBody() );
134
-	}
133
+        $this->assertContains( 'test exception', $object->getBody() );
134
+    }
135 135
 
136 136
 
137
-	public function testGetBodyMShopException()
138
-	{
139
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
140
-			->setConstructorArgs( array( $this->context, array() ) )
141
-			->setMethods( array( 'setViewParams' ) )
142
-			->getMock();
137
+    public function testGetBodyMShopException()
138
+    {
139
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stage\Standard' )
140
+            ->setConstructorArgs( array( $this->context, array() ) )
141
+            ->setMethods( array( 'setViewParams' ) )
142
+            ->getMock();
143 143
 
144
-		$object->expects( $this->once() )->method( 'setViewParams' )
145
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
144
+        $object->expects( $this->once() )->method( 'setViewParams' )
145
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
146 146
 
147
-		$object->setView( \TestHelperHtml::getView() );
147
+        $object->setView( \TestHelperHtml::getView() );
148 148
 
149
-		$this->assertContains( 'test exception', $object->getBody() );
150
-	}
149
+        $this->assertContains( 'test exception', $object->getBody() );
150
+    }
151 151
 
152 152
 
153
-	public function testModifyBody()
154
-	{
155
-		$this->assertEquals( 'test', $this->object->modifyBody( 'test', 1 ) );
156
-	}
153
+    public function testModifyBody()
154
+    {
155
+        $this->assertEquals( 'test', $this->object->modifyBody( 'test', 1 ) );
156
+    }
157 157
 
158 158
 
159
-	public function testModifyHeader()
160
-	{
161
-		$this->assertEquals( 'test', $this->object->modifyHeader( 'test', 1 ) );
162
-	}
159
+    public function testModifyHeader()
160
+    {
161
+        $this->assertEquals( 'test', $this->object->modifyHeader( 'test', 1 ) );
162
+    }
163 163
 
164 164
 
165
-	public function testGetSubClient()
166
-	{
167
-		$client = $this->object->getSubClient( 'image', 'Standard' );
168
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
169
-	}
165
+    public function testGetSubClient()
166
+    {
167
+        $client = $this->object->getSubClient( 'image', 'Standard' );
168
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
169
+    }
170 170
 
171 171
 
172
-	public function testGetSubClientInvalid()
173
-	{
174
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
175
-		$this->object->getSubClient( 'invalid', 'invalid' );
176
-	}
172
+    public function testGetSubClientInvalid()
173
+    {
174
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
175
+        $this->object->getSubClient( 'invalid', 'invalid' );
176
+    }
177 177
 
178 178
 
179
-	public function testGetSubClientInvalidName()
180
-	{
181
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
182
-		$this->object->getSubClient( '$$$', '$$$' );
183
-	}
179
+    public function testGetSubClientInvalidName()
180
+    {
181
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
182
+        $this->object->getSubClient( '$$$', '$$$' );
183
+    }
184 184
 
185 185
 
186
-	public function testProcess()
187
-	{
188
-		$this->object->process();
189
-	}
186
+    public function testProcess()
187
+    {
188
+        $this->object->process();
189
+    }
190 190
 
191 191
 
192
-	protected function getCatalogItem()
193
-	{
194
-		$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
195
-		$search = $catalogManager->createSearch();
196
-		$search->setConditions( $search->compare( '==', 'catalog.code', 'cafe' ) );
197
-		$items = $catalogManager->searchItems( $search );
192
+    protected function getCatalogItem()
193
+    {
194
+        $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
195
+        $search = $catalogManager->createSearch();
196
+        $search->setConditions( $search->compare( '==', 'catalog.code', 'cafe' ) );
197
+        $items = $catalogManager->searchItems( $search );
198 198
 
199
-		if( ( $item = reset( $items ) ) === false ) {
200
-			throw new \Exception( 'No catalog item with code "cafe" found' );
201
-		}
199
+        if( ( $item = reset( $items ) ) === false ) {
200
+            throw new \Exception( 'No catalog item with code "cafe" found' );
201
+        }
202 202
 
203
-		return $item;
204
-	}
203
+        return $item;
204
+    }
205 205
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Stock/StandardTest.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -10,114 +10,114 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20 20
 
21
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Stock\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Catalog\Stock\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$output = $this->object->getHeader();
36
-		$this->assertNotNull( $output );
37
-	}
33
+    public function testGetHeader()
34
+    {
35
+        $output = $this->object->getHeader();
36
+        $this->assertNotNull( $output );
37
+    }
38 38
 
39 39
 
40
-	public function testGetHeaderException()
41
-	{
42
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' )
43
-			->setConstructorArgs( array( $this->context, array() ) )
44
-			->setMethods( array( 'setViewParams' ) )
45
-			->getMock();
40
+    public function testGetHeaderException()
41
+    {
42
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' )
43
+            ->setConstructorArgs( array( $this->context, array() ) )
44
+            ->setMethods( array( 'setViewParams' ) )
45
+            ->getMock();
46 46
 
47
-		$object->expects( $this->once() )->method( 'setViewParams' )
48
-			->will( $this->throwException( new \Exception() ) );
47
+        $object->expects( $this->once() )->method( 'setViewParams' )
48
+            ->will( $this->throwException( new \Exception() ) );
49 49
 
50
-		$object->setView( \TestHelperHtml::getView() );
50
+        $object->setView( \TestHelperHtml::getView() );
51 51
 
52
-		$this->assertEquals( null, $object->getHeader() );
53
-	}
52
+        $this->assertEquals( null, $object->getHeader() );
53
+    }
54 54
 
55 55
 
56
-	public function testGetBody()
57
-	{
58
-		$productId = $this->getProductItem()->getId();
56
+    public function testGetBody()
57
+    {
58
+        $productId = $this->getProductItem()->getId();
59 59
 
60
-		$view = $this->object->getView();
61
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => $productId ) );
62
-		$view->addHelper( 'param', $helper );
60
+        $view = $this->object->getView();
61
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => $productId ) );
62
+        $view->addHelper( 'param', $helper );
63 63
 
64
-		$output = $this->object->getBody();
65
-		$this->assertRegExp( '/"' . $productId . '".*stock-high/', $output );
66
-	}
64
+        $output = $this->object->getBody();
65
+        $this->assertRegExp( '/"' . $productId . '".*stock-high/', $output );
66
+    }
67 67
 
68 68
 
69
-	public function testGetBodyStockUnlimited()
70
-	{
71
-		$view = $this->object->getView();
72
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => -1 ) );
73
-		$view->addHelper( 'param', $helper );
69
+    public function testGetBodyStockUnlimited()
70
+    {
71
+        $view = $this->object->getView();
72
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 's_prodid' => -1 ) );
73
+        $view->addHelper( 'param', $helper );
74 74
 
75
-		$output = $this->object->getBody();
76
-		$this->assertRegExp( '/"-1".*stock-unlimited/', $output );
77
-	}
75
+        $output = $this->object->getBody();
76
+        $this->assertRegExp( '/"-1".*stock-unlimited/', $output );
77
+    }
78 78
 
79 79
 
80
-	public function testGetBodyException()
81
-	{
82
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' )
83
-			->setConstructorArgs( array( $this->context, array() ) )
84
-			->setMethods( array( 'setViewParams' ) )
85
-			->getMock();
80
+    public function testGetBodyException()
81
+    {
82
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Stock\Standard' )
83
+            ->setConstructorArgs( array( $this->context, array() ) )
84
+            ->setMethods( array( 'setViewParams' ) )
85
+            ->getMock();
86 86
 
87
-		$object->expects( $this->once() )->method( 'setViewParams' )
88
-			->will( $this->throwException( new \Exception() ) );
87
+        $object->expects( $this->once() )->method( 'setViewParams' )
88
+            ->will( $this->throwException( new \Exception() ) );
89 89
 
90
-		$object->setView( \TestHelperHtml::getView() );
90
+        $object->setView( \TestHelperHtml::getView() );
91 91
 
92
-		$this->assertEquals( null, $object->getBody() );
93
-	}
92
+        $this->assertEquals( null, $object->getBody() );
93
+    }
94 94
 
95 95
 
96
-	public function testGetSubClientInvalid()
97
-	{
98
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
99
-		$this->object->getSubClient( 'invalid', 'invalid' );
100
-	}
96
+    public function testGetSubClientInvalid()
97
+    {
98
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
99
+        $this->object->getSubClient( 'invalid', 'invalid' );
100
+    }
101 101
 
102 102
 
103
-	public function testGetSubClientInvalidName()
104
-	{
105
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
106
-		$this->object->getSubClient( '$$$', '$$$' );
107
-	}
103
+    public function testGetSubClientInvalidName()
104
+    {
105
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
106
+        $this->object->getSubClient( '$$$', '$$$' );
107
+    }
108 108
 
109 109
 
110
-	protected function getProductItem()
111
-	{
112
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
113
-		$search = $manager->createSearch();
114
-		$search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) );
115
-		$items = $manager->searchItems( $search );
110
+    protected function getProductItem()
111
+    {
112
+        $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
113
+        $search = $manager->createSearch();
114
+        $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) );
115
+        $items = $manager->searchItems( $search );
116 116
 
117
-		if( ( $item = reset( $items ) ) === false ) {
118
-			throw new \Exception( 'No product item with code "CNC" found' );
119
-		}
117
+        if( ( $item = reset( $items ) ) === false ) {
118
+            throw new \Exception( 'No product item with code "CNC" found' );
119
+        }
120 120
 
121
-		return $item;
122
-	}
121
+        return $item;
122
+    }
123 123
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Detail/StandardTest.php 1 patch
Indentation   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -10,259 +10,259 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
20
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
21 21
 
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Detail\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
22
+        $this->object = new \Aimeos\Client\Html\Catalog\Detail\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$view = $this->object->getView();
36
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'd_prodid' => $this->getProductItem()->getId() ) );
37
-		$view->addHelper( 'param', $helper );
33
+    public function testGetHeader()
34
+    {
35
+        $view = $this->object->getView();
36
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'd_prodid' => $this->getProductItem()->getId() ) );
37
+        $view->addHelper( 'param', $helper );
38 38
 
39
-		$tags = array();
40
-		$expire = null;
41
-		$output = $this->object->getHeader( 1, $tags, $expire );
39
+        $tags = array();
40
+        $expire = null;
41
+        $output = $this->object->getHeader( 1, $tags, $expire );
42 42
 
43
-		$this->assertStringStartsWith( '	<title>Cafe Noire Cappuccino</title>', $output );
44
-		$this->assertEquals( '2022-01-01 00:00:00', $expire );
45
-		$this->assertEquals( 6, count( $tags ) );
46
-	}
43
+        $this->assertStringStartsWith( '	<title>Cafe Noire Cappuccino</title>', $output );
44
+        $this->assertEquals( '2022-01-01 00:00:00', $expire );
45
+        $this->assertEquals( 6, count( $tags ) );
46
+    }
47 47
 
48 48
 
49
-	public function testGetHeaderException()
50
-	{
51
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
52
-			->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
53
-			->setMethods( array( 'setViewParams' ) )
54
-			->getMock();
49
+    public function testGetHeaderException()
50
+    {
51
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
52
+            ->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
53
+            ->setMethods( array( 'setViewParams' ) )
54
+            ->getMock();
55 55
 
56
-		$mock->setView( \TestHelperHtml::getView() );
56
+        $mock->setView( \TestHelperHtml::getView() );
57 57
 
58
-		$mock->expects( $this->once() )->method( 'setViewParams' )
59
-			->will( $this->throwException( new \Exception() ) );
58
+        $mock->expects( $this->once() )->method( 'setViewParams' )
59
+            ->will( $this->throwException( new \Exception() ) );
60 60
 
61
-		$mock->getHeader();
62
-	}
61
+        $mock->getHeader();
62
+    }
63 63
 
64 64
 
65
-	public function testGetBody()
66
-	{
67
-		$view = $this->object->getView();
68
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'd_prodid' => $this->getProductItem()->getId() ) );
69
-		$view->addHelper( 'param', $helper );
65
+    public function testGetBody()
66
+    {
67
+        $view = $this->object->getView();
68
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'd_prodid' => $this->getProductItem()->getId() ) );
69
+        $view->addHelper( 'param', $helper );
70 70
 
71
-		$tags = array();
72
-		$expire = null;
73
-		$output = $this->object->getBody( 1, $tags, $expire );
71
+        $tags = array();
72
+        $expire = null;
73
+        $output = $this->object->getBody( 1, $tags, $expire );
74 74
 
75
-		$this->assertStringStartsWith( '<section class="aimeos catalog-detail"', $output );
76
-		$this->assertEquals( '2022-01-01 00:00:00', $expire );
77
-		$this->assertEquals( 6, count( $tags ) );
78
-	}
75
+        $this->assertStringStartsWith( '<section class="aimeos catalog-detail"', $output );
76
+        $this->assertEquals( '2022-01-01 00:00:00', $expire );
77
+        $this->assertEquals( 6, count( $tags ) );
78
+    }
79 79
 
80 80
 
81
-	public function testGetBodyDefaultId()
82
-	{
83
-		$context = clone $this->context;
84
-		$context->getConfig()->set( 'client/html/catalog/detail/prodid-default', $this->getProductItem()->getId() );
81
+    public function testGetBodyDefaultId()
82
+    {
83
+        $context = clone $this->context;
84
+        $context->getConfig()->set( 'client/html/catalog/detail/prodid-default', $this->getProductItem()->getId() );
85 85
 
86
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
87
-		$this->object = new \Aimeos\Client\Html\Catalog\Detail\Standard( $context, $paths );
88
-		$this->object->setView( \TestHelperHtml::getView() );
86
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
87
+        $this->object = new \Aimeos\Client\Html\Catalog\Detail\Standard( $context, $paths );
88
+        $this->object->setView( \TestHelperHtml::getView() );
89 89
 
90
-		$view = $this->object->getView();
91
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
92
-		$view->addHelper( 'param', $helper );
90
+        $view = $this->object->getView();
91
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
92
+        $view->addHelper( 'param', $helper );
93 93
 
94
-		$output = $this->object->getBody();
94
+        $output = $this->object->getBody();
95 95
 
96
-		$this->assertContains( '<span class="value" itemprop="sku">CNC</span>', $output );
97
-	}
96
+        $this->assertContains( '<span class="value" itemprop="sku">CNC</span>', $output );
97
+    }
98 98
 
99 99
 
100
-	public function testGetBodyClientHtmlException()
101
-	{
102
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
103
-			->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
104
-			->setMethods( array( 'setViewParams' ) )
105
-			->getMock();
100
+    public function testGetBodyClientHtmlException()
101
+    {
102
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
103
+            ->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
104
+            ->setMethods( array( 'setViewParams' ) )
105
+            ->getMock();
106 106
 
107
-		$mock->setView( \TestHelperHtml::getView() );
107
+        $mock->setView( \TestHelperHtml::getView() );
108 108
 
109
-		$mock->expects( $this->once() )->method( 'setViewParams' )
110
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception() ) );
109
+        $mock->expects( $this->once() )->method( 'setViewParams' )
110
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception() ) );
111 111
 
112
-		$mock->getBody();
113
-	}
112
+        $mock->getBody();
113
+    }
114 114
 
115 115
 
116
-	public function testGetBodyControllerFrontendException()
117
-	{
118
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
119
-			->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
120
-			->setMethods( array( 'setViewParams' ) )
121
-			->getMock();
116
+    public function testGetBodyControllerFrontendException()
117
+    {
118
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
119
+            ->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
120
+            ->setMethods( array( 'setViewParams' ) )
121
+            ->getMock();
122 122
 
123
-		$mock->setView( \TestHelperHtml::getView() );
123
+        $mock->setView( \TestHelperHtml::getView() );
124 124
 
125
-		$mock->expects( $this->once() )->method( 'setViewParams' )
126
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception() ) );
125
+        $mock->expects( $this->once() )->method( 'setViewParams' )
126
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception() ) );
127 127
 
128
-		$mock->getBody();
129
-	}
128
+        $mock->getBody();
129
+    }
130 130
 
131 131
 
132
-	public function testGetBodyMShopException()
133
-	{
134
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
135
-			->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
136
-			->setMethods( array( 'setViewParams' ) )
137
-			->getMock();
132
+    public function testGetBodyMShopException()
133
+    {
134
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
135
+            ->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
136
+            ->setMethods( array( 'setViewParams' ) )
137
+            ->getMock();
138 138
 
139
-		$mock->setView( \TestHelperHtml::getView() );
139
+        $mock->setView( \TestHelperHtml::getView() );
140 140
 
141
-		$mock->expects( $this->once() )->method( 'setViewParams' )
142
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
141
+        $mock->expects( $this->once() )->method( 'setViewParams' )
142
+            ->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
143 143
 
144
-		$mock->getBody();
145
-	}
144
+        $mock->getBody();
145
+    }
146 146
 
147 147
 
148
-	public function testGetBodyException()
149
-	{
150
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
151
-			->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
152
-			->setMethods( array( 'setViewParams' ) )
153
-			->getMock();
148
+    public function testGetBodyException()
149
+    {
150
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
151
+            ->setConstructorArgs( array( $this->context, \TestHelperHtml::getHtmlTemplatePaths() ) )
152
+            ->setMethods( array( 'setViewParams' ) )
153
+            ->getMock();
154 154
 
155
-		$mock->setView( \TestHelperHtml::getView() );
155
+        $mock->setView( \TestHelperHtml::getView() );
156 156
 
157
-		$mock->expects( $this->once() )->method( 'setViewParams' )
158
-			->will( $this->throwException( new \Exception() ) );
157
+        $mock->expects( $this->once() )->method( 'setViewParams' )
158
+            ->will( $this->throwException( new \Exception() ) );
159 159
 
160
-		$mock->getBody();
161
-	}
160
+        $mock->getBody();
161
+    }
162 162
 
163 163
 
164
-	public function testGetSubClient()
165
-	{
166
-		$client = $this->object->getSubClient( 'basic', 'Standard' );
167
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
168
-	}
164
+    public function testGetSubClient()
165
+    {
166
+        $client = $this->object->getSubClient( 'basic', 'Standard' );
167
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
168
+    }
169 169
 
170 170
 
171
-	public function testGetSubClientInvalid()
172
-	{
173
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
174
-		$this->object->getSubClient( 'invalid', 'invalid' );
175
-	}
171
+    public function testGetSubClientInvalid()
172
+    {
173
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
174
+        $this->object->getSubClient( 'invalid', 'invalid' );
175
+    }
176 176
 
177 177
 
178
-	public function testGetSubClientInvalidName()
179
-	{
180
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
181
-		$this->object->getSubClient( '$$$', '$$$' );
182
-	}
178
+    public function testGetSubClientInvalidName()
179
+    {
180
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
181
+        $this->object->getSubClient( '$$$', '$$$' );
182
+    }
183 183
 
184 184
 
185
-	public function testProcess()
186
-	{
187
-		$this->object->process();
188
-	}
185
+    public function testProcess()
186
+    {
187
+        $this->object->process();
188
+    }
189 189
 
190 190
 
191
-	public function testProcessClientHtmlException()
192
-	{
193
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
194
-			->setConstructorArgs( array( $this->context, array() ) )
195
-			->setMethods( array( 'getClientParams' ) )
196
-			->getMock();
191
+    public function testProcessClientHtmlException()
192
+    {
193
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
194
+            ->setConstructorArgs( array( $this->context, array() ) )
195
+            ->setMethods( array( 'getClientParams' ) )
196
+            ->getMock();
197 197
 
198
-		$mock->setView( \TestHelperHtml::getView() );
198
+        $mock->setView( \TestHelperHtml::getView() );
199 199
 
200
-		$mock->expects( $this->once() )->method( 'getClientParams' )
201
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception() ) );
200
+        $mock->expects( $this->once() )->method( 'getClientParams' )
201
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception() ) );
202 202
 
203
-		$mock->process();
204
-	}
203
+        $mock->process();
204
+    }
205 205
 
206 206
 
207
-	public function testProcessControllerFrontendException()
208
-	{
209
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
210
-			->setConstructorArgs( array( $this->context, array() ) )
211
-			->setMethods( array( 'getClientParams' ) )
212
-			->getMock();
207
+    public function testProcessControllerFrontendException()
208
+    {
209
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
210
+            ->setConstructorArgs( array( $this->context, array() ) )
211
+            ->setMethods( array( 'getClientParams' ) )
212
+            ->getMock();
213 213
 
214
-		$mock->setView( \TestHelperHtml::getView() );
214
+        $mock->setView( \TestHelperHtml::getView() );
215 215
 
216
-		$mock->expects( $this->once() )->method( 'getClientParams' )
217
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception() ) );
216
+        $mock->expects( $this->once() )->method( 'getClientParams' )
217
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception() ) );
218 218
 
219
-		$mock->process();
220
-	}
219
+        $mock->process();
220
+    }
221 221
 
222 222
 
223
-	public function testProcessMShopException()
224
-	{
225
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
226
-			->setConstructorArgs( array( $this->context, array() ) )
227
-			->setMethods( array( 'getClientParams' ) )
228
-			->getMock();
223
+    public function testProcessMShopException()
224
+    {
225
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
226
+            ->setConstructorArgs( array( $this->context, array() ) )
227
+            ->setMethods( array( 'getClientParams' ) )
228
+            ->getMock();
229 229
 
230
-		$mock->setView( \TestHelperHtml::getView() );
230
+        $mock->setView( \TestHelperHtml::getView() );
231 231
 
232
-		$mock->expects( $this->once() )->method( 'getClientParams' )
233
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
232
+        $mock->expects( $this->once() )->method( 'getClientParams' )
233
+            ->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
234 234
 
235
-		$mock->process();
236
-	}
235
+        $mock->process();
236
+    }
237 237
 
238 238
 
239
-	public function testProcessException()
240
-	{
241
-		$mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
242
-			->setConstructorArgs( array( $this->context, array() ) )
243
-			->setMethods( array( 'getClientParams' ) )
244
-			->getMock();
239
+    public function testProcessException()
240
+    {
241
+        $mock = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Detail\Standard' )
242
+            ->setConstructorArgs( array( $this->context, array() ) )
243
+            ->setMethods( array( 'getClientParams' ) )
244
+            ->getMock();
245 245
 
246
-		$mock->setView( \TestHelperHtml::getView() );
246
+        $mock->setView( \TestHelperHtml::getView() );
247 247
 
248
-		$mock->expects( $this->once() )->method( 'getClientParams' )
249
-			->will( $this->throwException( new \Exception() ) );
248
+        $mock->expects( $this->once() )->method( 'getClientParams' )
249
+            ->will( $this->throwException( new \Exception() ) );
250 250
 
251
-		$mock->process();
252
-	}
251
+        $mock->process();
252
+    }
253 253
 
254 254
 
255
-	protected function getProductItem()
256
-	{
257
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
258
-		$search = $manager->createSearch();
259
-		$search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) );
260
-		$items = $manager->searchItems( $search );
255
+    protected function getProductItem()
256
+    {
257
+        $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
258
+        $search = $manager->createSearch();
259
+        $search->setConditions( $search->compare( '==', 'product.code', 'CNC' ) );
260
+        $items = $manager->searchItems( $search );
261 261
 
262
-		if( ( $item = reset( $items ) ) === false ) {
263
-			throw new \Exception( 'No product item with code "CNC" found' );
264
-		}
262
+        if( ( $item = reset( $items ) ) === false ) {
263
+            throw new \Exception( 'No product item with code "CNC" found' );
264
+        }
265 265
 
266
-		return $item;
267
-	}
266
+        return $item;
267
+    }
268 268
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Session/StandardTest.php 1 patch
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -10,155 +10,155 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	/**
18
-	 * Sets up the fixture, for example, opens a network connection.
19
-	 * This method is called before a test is executed.
20
-	 *
21
-	 * @access protected
22
-	 */
23
-	protected function setUp()
24
-	{
25
-		$this->context = \TestHelperHtml::getContext();
17
+    /**
18
+     * Sets up the fixture, for example, opens a network connection.
19
+     * This method is called before a test is executed.
20
+     *
21
+     * @access protected
22
+     */
23
+    protected function setUp()
24
+    {
25
+        $this->context = \TestHelperHtml::getContext();
26 26
 
27
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
28
-		$this->object = new \Aimeos\Client\Html\Catalog\Session\Standard( $this->context, $paths );
29
-		$this->object->setView( \TestHelperHtml::getView() );
30
-	}
27
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
28
+        $this->object = new \Aimeos\Client\Html\Catalog\Session\Standard( $this->context, $paths );
29
+        $this->object->setView( \TestHelperHtml::getView() );
30
+    }
31 31
 
32 32
 
33
-	/**
34
-	 * Tears down the fixture, for example, closes a network connection.
35
-	 * This method is called after a test is executed.
36
-	 *
37
-	 * @access protected
38
-	 */
39
-	protected function tearDown()
40
-	{
41
-		unset( $this->object );
42
-	}
33
+    /**
34
+     * Tears down the fixture, for example, closes a network connection.
35
+     * This method is called after a test is executed.
36
+     *
37
+     * @access protected
38
+     */
39
+    protected function tearDown()
40
+    {
41
+        unset( $this->object );
42
+    }
43 43
 
44 44
 
45
-	public function testGetHeader()
46
-	{
47
-		$output = $this->object->getHeader();
48
-		$this->assertNotNull( $output );
49
-	}
45
+    public function testGetHeader()
46
+    {
47
+        $output = $this->object->getHeader();
48
+        $this->assertNotNull( $output );
49
+    }
50 50
 
51 51
 
52
-	public function testGetHeaderException()
53
-	{
54
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
55
-			->setConstructorArgs( array( $this->context, array() ) )
56
-			->setMethods( array( 'setViewParams' ) )
57
-			->getMock();
52
+    public function testGetHeaderException()
53
+    {
54
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
55
+            ->setConstructorArgs( array( $this->context, array() ) )
56
+            ->setMethods( array( 'setViewParams' ) )
57
+            ->getMock();
58 58
 
59
-		$object->expects( $this->once() )->method( 'setViewParams' )
60
-			->will( $this->throwException( new \Exception() ) );
59
+        $object->expects( $this->once() )->method( 'setViewParams' )
60
+            ->will( $this->throwException( new \Exception() ) );
61 61
 
62
-		$object->setView( \TestHelperHtml::getView() );
62
+        $object->setView( \TestHelperHtml::getView() );
63 63
 
64
-		$this->assertEquals( null, $object->getHeader() );
65
-	}
64
+        $this->assertEquals( null, $object->getHeader() );
65
+    }
66 66
 
67 67
 
68
-	public function testGetBody()
69
-	{
70
-		$output = $this->object->getBody();
71
-		$this->assertStringStartsWith( '<section class="aimeos catalog-session">', $output );
72
-	}
68
+    public function testGetBody()
69
+    {
70
+        $output = $this->object->getBody();
71
+        $this->assertStringStartsWith( '<section class="aimeos catalog-session">', $output );
72
+    }
73 73
 
74 74
 
75
-	public function testGetBodyHtmlException()
76
-	{
77
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
78
-			->setConstructorArgs( array( $this->context, array() ) )
79
-			->setMethods( array( 'setViewParams' ) )
80
-			->getMock();
75
+    public function testGetBodyHtmlException()
76
+    {
77
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
78
+            ->setConstructorArgs( array( $this->context, array() ) )
79
+            ->setMethods( array( 'setViewParams' ) )
80
+            ->getMock();
81 81
 
82
-		$object->expects( $this->once() )->method( 'setViewParams' )
83
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
82
+        $object->expects( $this->once() )->method( 'setViewParams' )
83
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
84 84
 
85
-		$object->setView( \TestHelperHtml::getView() );
85
+        $object->setView( \TestHelperHtml::getView() );
86 86
 
87
-		$this->assertContains( 'test exception', $object->getBody() );
88
-	}
87
+        $this->assertContains( 'test exception', $object->getBody() );
88
+    }
89 89
 
90 90
 
91
-	public function testGetBodyFrontendException()
92
-	{
93
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
94
-			->setConstructorArgs( array( $this->context, array() ) )
95
-			->setMethods( array( 'setViewParams' ) )
96
-			->getMock();
91
+    public function testGetBodyFrontendException()
92
+    {
93
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
94
+            ->setConstructorArgs( array( $this->context, array() ) )
95
+            ->setMethods( array( 'setViewParams' ) )
96
+            ->getMock();
97 97
 
98
-		$object->expects( $this->once() )->method( 'setViewParams' )
99
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
98
+        $object->expects( $this->once() )->method( 'setViewParams' )
99
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
100 100
 
101
-		$object->setView( \TestHelperHtml::getView() );
101
+        $object->setView( \TestHelperHtml::getView() );
102 102
 
103
-		$this->assertContains( 'test exception', $object->getBody() );
104
-	}
103
+        $this->assertContains( 'test exception', $object->getBody() );
104
+    }
105 105
 
106 106
 
107
-	public function testGetBodyMShopException()
108
-	{
109
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
110
-			->setConstructorArgs( array( $this->context, array() ) )
111
-			->setMethods( array( 'setViewParams' ) )
112
-			->getMock();
107
+    public function testGetBodyMShopException()
108
+    {
109
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
110
+            ->setConstructorArgs( array( $this->context, array() ) )
111
+            ->setMethods( array( 'setViewParams' ) )
112
+            ->getMock();
113 113
 
114
-		$object->expects( $this->once() )->method( 'setViewParams' )
115
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
114
+        $object->expects( $this->once() )->method( 'setViewParams' )
115
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
116 116
 
117
-		$object->setView( \TestHelperHtml::getView() );
117
+        $object->setView( \TestHelperHtml::getView() );
118 118
 
119
-		$this->assertContains( 'test exception', $object->getBody() );
120
-	}
119
+        $this->assertContains( 'test exception', $object->getBody() );
120
+    }
121 121
 
122 122
 
123
-	public function testGetBodyException()
124
-	{
125
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
126
-			->setConstructorArgs( array( $this->context, array() ) )
127
-			->setMethods( array( 'setViewParams' ) )
128
-			->getMock();
123
+    public function testGetBodyException()
124
+    {
125
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Session\Standard' )
126
+            ->setConstructorArgs( array( $this->context, array() ) )
127
+            ->setMethods( array( 'setViewParams' ) )
128
+            ->getMock();
129 129
 
130
-		$object->expects( $this->once() )->method( 'setViewParams' )
131
-			->will( $this->throwException( new \Exception() ) );
130
+        $object->expects( $this->once() )->method( 'setViewParams' )
131
+            ->will( $this->throwException( new \Exception() ) );
132 132
 
133
-		$object->setView( \TestHelperHtml::getView() );
133
+        $object->setView( \TestHelperHtml::getView() );
134 134
 
135
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
136
-	}
135
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
136
+    }
137 137
 
138 138
 
139
-	public function testGetSubClient()
140
-	{
141
-		$client = $this->object->getSubClient( 'seen', 'Standard' );
142
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
143
-	}
139
+    public function testGetSubClient()
140
+    {
141
+        $client = $this->object->getSubClient( 'seen', 'Standard' );
142
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
143
+    }
144 144
 
145 145
 
146
-	public function testGetSubClientInvalid()
147
-	{
148
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
149
-		$this->object->getSubClient( 'invalid', 'invalid' );
150
-	}
146
+    public function testGetSubClientInvalid()
147
+    {
148
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
149
+        $this->object->getSubClient( 'invalid', 'invalid' );
150
+    }
151 151
 
152 152
 
153
-	public function testGetSubClientInvalidName()
154
-	{
155
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
156
-		$this->object->getSubClient( '$$$', '$$$' );
157
-	}
153
+    public function testGetSubClientInvalidName()
154
+    {
155
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
156
+        $this->object->getSubClient( '$$$', '$$$' );
157
+    }
158 158
 
159 159
 
160
-	public function testProcess()
161
-	{
162
-		$this->object->process();
163
-	}
160
+    public function testProcess()
161
+    {
162
+        $this->object->process();
163
+    }
164 164
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Lists/StandardTest.php 1 patch
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -10,236 +10,236 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
20
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
21 21
 
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
22
+        $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$view = $this->object->getView();
36
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
37
-		$view->addHelper( 'param', $helper );
33
+    public function testGetHeader()
34
+    {
35
+        $view = $this->object->getView();
36
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
37
+        $view->addHelper( 'param', $helper );
38 38
 
39
-		$tags = array();
40
-		$expire = null;
41
-		$output = $this->object->getHeader( 1, $tags, $expire );
39
+        $tags = array();
40
+        $expire = null;
41
+        $output = $this->object->getHeader( 1, $tags, $expire );
42 42
 
43
-		$this->assertStringStartsWith( '	<title>Kaffee</title>', $output );
44
-		$this->assertEquals( '2022-01-01 00:00:00', $expire );
45
-		$this->assertEquals( 4, count( $tags ) );
46
-	}
43
+        $this->assertStringStartsWith( '	<title>Kaffee</title>', $output );
44
+        $this->assertEquals( '2022-01-01 00:00:00', $expire );
45
+        $this->assertEquals( 4, count( $tags ) );
46
+    }
47 47
 
48 48
 
49
-	public function testGetHeaderSearch()
50
-	{
51
-		$view = $this->object->getView();
52
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => '<b>Search result</b>' ) );
53
-		$view->addHelper( 'param', $helper );
49
+    public function testGetHeaderSearch()
50
+    {
51
+        $view = $this->object->getView();
52
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => '<b>Search result</b>' ) );
53
+        $view->addHelper( 'param', $helper );
54 54
 
55
-		$tags = array();
56
-		$expire = null;
57
-		$output = $this->object->getHeader( 1, $tags, $expire );
55
+        $tags = array();
56
+        $expire = null;
57
+        $output = $this->object->getHeader( 1, $tags, $expire );
58 58
 
59
-		$this->assertRegexp( '#<title>[^>]*Search result[^<]*</title>#', $output );
60
-		$this->assertEquals( null, $expire );
61
-		$this->assertEquals( 1, count( $tags ) );
62
-	}
59
+        $this->assertRegexp( '#<title>[^>]*Search result[^<]*</title>#', $output );
60
+        $this->assertEquals( null, $expire );
61
+        $this->assertEquals( 1, count( $tags ) );
62
+    }
63 63
 
64 64
 
65
-	public function testGetBody()
66
-	{
67
-		$view = $this->object->getView();
68
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
69
-		$view->addHelper( 'param', $helper );
65
+    public function testGetBody()
66
+    {
67
+        $view = $this->object->getView();
68
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem()->getId() ) );
69
+        $view->addHelper( 'param', $helper );
70 70
 
71
-		$tags = array();
72
-		$expire = null;
73
-		$output = $this->object->getBody( 1, $tags, $expire );
71
+        $tags = array();
72
+        $expire = null;
73
+        $output = $this->object->getBody( 1, $tags, $expire );
74 74
 
75
-		$this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output );
76
-		$this->assertEquals( '2022-01-01 00:00:00', $expire );
77
-		$this->assertEquals( 4, count( $tags ) );
78
-	}
75
+        $this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output );
76
+        $this->assertEquals( '2022-01-01 00:00:00', $expire );
77
+        $this->assertEquals( 4, count( $tags ) );
78
+    }
79 79
 
80 80
 
81
-	public function testGetBodyNoDefaultCat()
82
-	{
83
-		$view = $this->object->getView();
84
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
85
-		$view->addHelper( 'param', $helper );
81
+    public function testGetBodyNoDefaultCat()
82
+    {
83
+        $view = $this->object->getView();
84
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
85
+        $view->addHelper( 'param', $helper );
86 86
 
87
-		$output = $this->object->getBody();
88
-		$this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
89
-		$this->assertNotRegExp( '#.*U:TESTPSUB01.*#smu', $output );
90
-		$this->assertNotRegExp( '#.*U:TESTSUB03.*#smu', $output );
91
-		$this->assertNotRegExp( '#.*U:TESTSUB04.*#smu', $output );
92
-		$this->assertNotRegExp( '#.*U:TESTSUB05.*#smu', $output );
93
-	}
87
+        $output = $this->object->getBody();
88
+        $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
89
+        $this->assertNotRegExp( '#.*U:TESTPSUB01.*#smu', $output );
90
+        $this->assertNotRegExp( '#.*U:TESTSUB03.*#smu', $output );
91
+        $this->assertNotRegExp( '#.*U:TESTSUB04.*#smu', $output );
92
+        $this->assertNotRegExp( '#.*U:TESTSUB05.*#smu', $output );
93
+    }
94 94
 
95 95
 
96
-	public function testGetBodyDefaultCat()
97
-	{
98
-		$context = clone $this->context;
99
-		$context->getConfig()->set( 'client/html/catalog/lists/catid-default', $this->getCatalogItem()->getId() );
96
+    public function testGetBodyDefaultCat()
97
+    {
98
+        $context = clone $this->context;
99
+        $context->getConfig()->set( 'client/html/catalog/lists/catid-default', $this->getCatalogItem()->getId() );
100 100
 
101
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
102
-		$this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths );
103
-		$this->object->setView( \TestHelperHtml::getView() );
101
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
102
+        $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths );
103
+        $this->object->setView( \TestHelperHtml::getView() );
104 104
 
105
-		$view = $this->object->getView();
106
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
107
-		$view->addHelper( 'param', $helper );
105
+        $view = $this->object->getView();
106
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array() );
107
+        $view->addHelper( 'param', $helper );
108 108
 
109
-		$output = $this->object->getBody();
110
-		$this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output );
111
-	}
109
+        $output = $this->object->getBody();
110
+        $this->assertStringStartsWith( '<section class="aimeos catalog-list home categories coffee">', $output );
111
+    }
112 112
 
113 113
 
114
-	public function testGetBodyCategoryLevels()
115
-	{
116
-		$context = clone $this->context;
117
-		$context->getConfig()->set( 'client/html/catalog/lists/levels', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );
114
+    public function testGetBodyCategoryLevels()
115
+    {
116
+        $context = clone $this->context;
117
+        $context->getConfig()->set( 'client/html/catalog/lists/levels', \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );
118 118
 
119
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
120
-		$this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths );
121
-		$this->object->setView( \TestHelperHtml::getView() );
119
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
120
+        $this->object = new \Aimeos\Client\Html\Catalog\Lists\Standard( $context, $paths );
121
+        $this->object->setView( \TestHelperHtml::getView() );
122 122
 
123
-		$view = $this->object->getView();
124
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem( 'root' )->getId() ) );
125
-		$view->addHelper( 'param', $helper );
123
+        $view = $this->object->getView();
124
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_catid' => $this->getCatalogItem( 'root' )->getId() ) );
125
+        $view->addHelper( 'param', $helper );
126 126
 
127
-		$output = $this->object->getBody();
128
-		$this->assertRegExp( '#.*Cafe Noire Cappuccino.*#smu', $output );
129
-		$this->assertRegExp( '#.*Cafe Noire Expresso.*#smu', $output );
130
-		$this->assertRegExp( '#.*Unittest: Bundle.*#smu', $output );
131
-		$this->assertRegExp( '#.*Unittest: Test priced Selection.*#smu', $output );
132
-	}
127
+        $output = $this->object->getBody();
128
+        $this->assertRegExp( '#.*Cafe Noire Cappuccino.*#smu', $output );
129
+        $this->assertRegExp( '#.*Cafe Noire Expresso.*#smu', $output );
130
+        $this->assertRegExp( '#.*Unittest: Bundle.*#smu', $output );
131
+        $this->assertRegExp( '#.*Unittest: Test priced Selection.*#smu', $output );
132
+    }
133 133
 
134 134
 
135
-	public function testGetBodySearchText()
136
-	{
137
-		$view = $this->object->getView();
138
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Kaffee' ) );
139
-		$view->addHelper( 'param', $helper );
135
+    public function testGetBodySearchText()
136
+    {
137
+        $view = $this->object->getView();
138
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Kaffee' ) );
139
+        $view->addHelper( 'param', $helper );
140 140
 
141
-		$output = $this->object->getBody();
142
-		$this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
143
-	}
141
+        $output = $this->object->getBody();
142
+        $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
143
+    }
144 144
 
145 145
 
146
-	public function testGetBodySearchAttribute()
147
-	{
148
-		$view = $this->object->getView();
149
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_attrid' => array( -1, -2 ) ) );
150
-		$view->addHelper( 'param', $helper );
146
+    public function testGetBodySearchAttribute()
147
+    {
148
+        $view = $this->object->getView();
149
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_attrid' => array( -1, -2 ) ) );
150
+        $view->addHelper( 'param', $helper );
151 151
 
152
-		$output = $this->object->getBody();
153
-		$this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
154
-	}
152
+        $output = $this->object->getBody();
153
+        $this->assertStringStartsWith( '<section class="aimeos catalog-list">', $output );
154
+    }
155 155
 
156 156
 
157
-	public function testGetBodyHtmlException()
158
-	{
159
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
160
-			->setConstructorArgs( array( $this->context, array() ) )
161
-			->setMethods( array( 'setViewParams' ) )
162
-			->getMock();
157
+    public function testGetBodyHtmlException()
158
+    {
159
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
160
+            ->setConstructorArgs( array( $this->context, array() ) )
161
+            ->setMethods( array( 'setViewParams' ) )
162
+            ->getMock();
163 163
 
164
-		$object->expects( $this->once() )->method( 'setViewParams' )
165
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
164
+        $object->expects( $this->once() )->method( 'setViewParams' )
165
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
166 166
 
167
-		$object->setView( \TestHelperHtml::getView() );
167
+        $object->setView( \TestHelperHtml::getView() );
168 168
 
169
-		$this->assertContains( 'test exception', $object->getBody() );
170
-	}
169
+        $this->assertContains( 'test exception', $object->getBody() );
170
+    }
171 171
 
172 172
 
173
-	public function testGetBodyFrontendException()
174
-	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
176
-			->setConstructorArgs( array( $this->context, array() ) )
177
-			->setMethods( array( 'setViewParams' ) )
178
-			->getMock();
173
+    public function testGetBodyFrontendException()
174
+    {
175
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
176
+            ->setConstructorArgs( array( $this->context, array() ) )
177
+            ->setMethods( array( 'setViewParams' ) )
178
+            ->getMock();
179 179
 
180
-		$object->expects( $this->once() )->method( 'setViewParams' )
181
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
180
+        $object->expects( $this->once() )->method( 'setViewParams' )
181
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
182 182
 
183
-		$object->setView( \TestHelperHtml::getView() );
183
+        $object->setView( \TestHelperHtml::getView() );
184 184
 
185
-		$this->assertContains( 'test exception', $object->getBody() );
186
-	}
185
+        $this->assertContains( 'test exception', $object->getBody() );
186
+    }
187 187
 
188 188
 
189
-	public function testGetBodyMShopException()
190
-	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
192
-			->setConstructorArgs( array( $this->context, array() ) )
193
-			->setMethods( array( 'setViewParams' ) )
194
-			->getMock();
189
+    public function testGetBodyMShopException()
190
+    {
191
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Lists\Standard' )
192
+            ->setConstructorArgs( array( $this->context, array() ) )
193
+            ->setMethods( array( 'setViewParams' ) )
194
+            ->getMock();
195 195
 
196
-		$object->expects( $this->once() )->method( 'setViewParams' )
197
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
196
+        $object->expects( $this->once() )->method( 'setViewParams' )
197
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
198 198
 
199
-		$object->setView( \TestHelperHtml::getView() );
199
+        $object->setView( \TestHelperHtml::getView() );
200 200
 
201
-		$this->assertContains( 'test exception', $object->getBody() );
202
-	}
201
+        $this->assertContains( 'test exception', $object->getBody() );
202
+    }
203 203
 
204 204
 
205
-	public function testGetSubClient()
206
-	{
207
-		$client = $this->object->getSubClient( 'items', 'Standard' );
208
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
209
-	}
205
+    public function testGetSubClient()
206
+    {
207
+        $client = $this->object->getSubClient( 'items', 'Standard' );
208
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
209
+    }
210 210
 
211 211
 
212
-	public function testGetSubClientInvalid()
213
-	{
214
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
215
-		$this->object->getSubClient( 'invalid', 'invalid' );
216
-	}
212
+    public function testGetSubClientInvalid()
213
+    {
214
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
215
+        $this->object->getSubClient( 'invalid', 'invalid' );
216
+    }
217 217
 
218 218
 
219
-	public function testGetSubClientInvalidName()
220
-	{
221
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
222
-		$this->object->getSubClient( '$$$', '$$$' );
223
-	}
219
+    public function testGetSubClientInvalidName()
220
+    {
221
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
222
+        $this->object->getSubClient( '$$$', '$$$' );
223
+    }
224 224
 
225 225
 
226
-	public function testProcess()
227
-	{
228
-		$this->object->process();
229
-	}
226
+    public function testProcess()
227
+    {
228
+        $this->object->process();
229
+    }
230 230
 
231 231
 
232
-	protected function getCatalogItem( $code = 'cafe' )
233
-	{
234
-		$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
235
-		$search = $catalogManager->createSearch();
236
-		$search->setConditions( $search->compare( '==', 'catalog.code', $code ) );
237
-		$items = $catalogManager->searchItems( $search );
232
+    protected function getCatalogItem( $code = 'cafe' )
233
+    {
234
+        $catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
235
+        $search = $catalogManager->createSearch();
236
+        $search->setConditions( $search->compare( '==', 'catalog.code', $code ) );
237
+        $items = $catalogManager->searchItems( $search );
238 238
 
239
-		if( ( $item = reset( $items ) ) === false ) {
240
-			throw new \Exception( sprintf( 'No catalog item with code "%1$s" found', $code ) );
241
-		}
239
+        if( ( $item = reset( $items ) ) === false ) {
240
+            throw new \Exception( sprintf( 'No catalog item with code "%1$s" found', $code ) );
241
+        }
242 242
 
243
-		return $item;
244
-	}
243
+        return $item;
244
+    }
245 245
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Catalog/Suggest/StandardTest.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -10,88 +10,88 @@
 block discarded – undo
10 10
  */
11 11
 class StandardTest extends \PHPUnit_Framework_TestCase
12 12
 {
13
-	private $object;
14
-	private $context;
13
+    private $object;
14
+    private $context;
15 15
 
16 16
 
17
-	protected function setUp()
18
-	{
19
-		$this->context = \TestHelperHtml::getContext();
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20 20
 
21
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths );
23
+        $this->object->setView( \TestHelperHtml::getView() );
24
+    }
25 25
 
26 26
 
27
-	protected function tearDown()
28
-	{
29
-		unset( $this->object );
30
-	}
27
+    protected function tearDown()
28
+    {
29
+        unset( $this->object );
30
+    }
31 31
 
32 32
 
33
-	public function testGetHeader()
34
-	{
35
-		$output = $this->object->getHeader();
36
-		$this->assertNotNull( $output );
37
-	}
33
+    public function testGetHeader()
34
+    {
35
+        $output = $this->object->getHeader();
36
+        $this->assertNotNull( $output );
37
+    }
38 38
 
39 39
 
40
-	public function testGetHeaderException()
41
-	{
42
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
43
-			->setConstructorArgs( array( $this->context, array() ) )
44
-			->setMethods( array( 'setViewParams' ) )
45
-			->getMock();
40
+    public function testGetHeaderException()
41
+    {
42
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
43
+            ->setConstructorArgs( array( $this->context, array() ) )
44
+            ->setMethods( array( 'setViewParams' ) )
45
+            ->getMock();
46 46
 
47
-		$object->expects( $this->once() )->method( 'setViewParams' )
48
-			->will( $this->throwException( new \Exception() ) );
47
+        $object->expects( $this->once() )->method( 'setViewParams' )
48
+            ->will( $this->throwException( new \Exception() ) );
49 49
 
50
-		$object->setView( \TestHelperHtml::getView() );
50
+        $object->setView( \TestHelperHtml::getView() );
51 51
 
52
-		$this->assertEquals( null, $object->getHeader() );
53
-	}
52
+        $this->assertEquals( null, $object->getHeader() );
53
+    }
54 54
 
55 55
 
56
-	public function testGetBody()
57
-	{
58
-		$view = $this->object->getView();
59
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) );
60
-		$view->addHelper( 'param', $helper );
56
+    public function testGetBody()
57
+    {
58
+        $view = $this->object->getView();
59
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) );
60
+        $view->addHelper( 'param', $helper );
61 61
 
62
-		$output = $this->object->getBody();
62
+        $output = $this->object->getBody();
63 63
 
64
-		$this->assertNotEquals( array(), $this->object->getView()->suggestTextItems );
65
-		$this->assertRegExp( '#"name":"Unterpro#smU', $output );
66
-	}
64
+        $this->assertNotEquals( array(), $this->object->getView()->suggestTextItems );
65
+        $this->assertRegExp( '#"name":"Unterpro#smU', $output );
66
+    }
67 67
 
68 68
 
69
-	public function testGetBodyException()
70
-	{
71
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
72
-			->setConstructorArgs( array( $this->context, array() ) )
73
-			->setMethods( array( 'setViewParams' ) )
74
-			->getMock();
69
+    public function testGetBodyException()
70
+    {
71
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
72
+            ->setConstructorArgs( array( $this->context, array() ) )
73
+            ->setMethods( array( 'setViewParams' ) )
74
+            ->getMock();
75 75
 
76
-		$object->expects( $this->once() )->method( 'setViewParams' )
77
-			->will( $this->throwException( new \Exception() ) );
76
+        $object->expects( $this->once() )->method( 'setViewParams' )
77
+            ->will( $this->throwException( new \Exception() ) );
78 78
 
79
-		$object->setView( \TestHelperHtml::getView() );
79
+        $object->setView( \TestHelperHtml::getView() );
80 80
 
81
-		$this->assertEquals( null, $object->getBody() );
82
-	}
81
+        $this->assertEquals( null, $object->getBody() );
82
+    }
83 83
 
84 84
 
85
-	public function testGetSubClientInvalid()
86
-	{
87
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
88
-		$this->object->getSubClient( 'invalid', 'invalid' );
89
-	}
85
+    public function testGetSubClientInvalid()
86
+    {
87
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
88
+        $this->object->getSubClient( 'invalid', 'invalid' );
89
+    }
90 90
 
91 91
 
92
-	public function testGetSubClientInvalidName()
93
-	{
94
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
95
-		$this->object->getSubClient( '$$$', '$$$' );
96
-	}
92
+    public function testGetSubClientInvalidName()
93
+    {
94
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
95
+        $this->object->getSubClient( '$$$', '$$$' );
96
+    }
97 97
 }
98 98
\ No newline at end of file
Please login to merge, or discard this patch.