Completed
Push — master ( d9c87d...d2fca1 )
by Aimeos
06:49
created
client/html/tests/Client/Html/Catalog/Count/StandardTest.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -10,91 +10,91 @@
 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
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
20
-		$this->context = \TestHelperHtml::getContext();
17
+    protected function setUp()
18
+    {
19
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
20
+        $this->context = \TestHelperHtml::getContext();
21 21
 
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Count\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
22
+        $this->object = new \Aimeos\Client\Html\Catalog\Count\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\Count\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\Count\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();
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59 59
 
60
-		$this->assertContains( 'var categoryCounts', $output );
61
-	}
60
+        $this->assertContains( 'var categoryCounts', $output );
61
+    }
62 62
 
63 63
 
64
-	public function testGetBodyException()
65
-	{
66
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Count\Standard' )
67
-			->setConstructorArgs( array( $this->context, array() ) )
68
-			->setMethods( array( 'setViewParams' ) )
69
-			->getMock();
64
+    public function testGetBodyException()
65
+    {
66
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Count\Standard' )
67
+            ->setConstructorArgs( array( $this->context, array() ) )
68
+            ->setMethods( array( 'setViewParams' ) )
69
+            ->getMock();
70 70
 
71
-		$object->expects( $this->once() )->method( 'setViewParams' )
72
-			->will( $this->throwException( new \Exception() ) );
71
+        $object->expects( $this->once() )->method( 'setViewParams' )
72
+            ->will( $this->throwException( new \Exception() ) );
73 73
 
74
-		$object->setView( \TestHelperHtml::getView() );
74
+        $object->setView( \TestHelperHtml::getView() );
75 75
 
76
-		$this->assertEquals( null, $object->getBody() );
77
-	}
76
+        $this->assertEquals( null, $object->getBody() );
77
+    }
78 78
 
79 79
 
80
-	public function testGetSubClient()
81
-	{
82
-		$client = $this->object->getSubClient( 'tree', 'Standard' );
83
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
84
-	}
80
+    public function testGetSubClient()
81
+    {
82
+        $client = $this->object->getSubClient( 'tree', 'Standard' );
83
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
84
+    }
85 85
 
86 86
 
87
-	public function testGetSubClientInvalid()
88
-	{
89
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
90
-		$this->object->getSubClient( 'invalid', 'invalid' );
91
-	}
87
+    public function testGetSubClientInvalid()
88
+    {
89
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
90
+        $this->object->getSubClient( 'invalid', 'invalid' );
91
+    }
92 92
 
93 93
 
94
-	public function testGetSubClientInvalidName()
95
-	{
96
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
97
-		$this->object->getSubClient( '$$$', '$$$' );
98
-	}
94
+    public function testGetSubClientInvalidName()
95
+    {
96
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
97
+        $this->object->getSubClient( '$$$', '$$$' );
98
+    }
99 99
 
100 100
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Checkout/Confirm/StandardTest.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -10,178 +10,178 @@
 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
-		$this->context->setEditor( 'UTC001' );
17
+    protected function setUp()
18
+    {
19
+        $this->context = \TestHelperHtml::getContext();
20
+        $this->context->setEditor( 'UTC001' );
21 21
 
22
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
23
-		$this->object = new \Aimeos\Client\Html\Checkout\Confirm\Standard( $this->context, $paths );
24
-		$this->object->setView( \TestHelperHtml::getView() );
25
-	}
22
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
23
+        $this->object = new \Aimeos\Client\Html\Checkout\Confirm\Standard( $this->context, $paths );
24
+        $this->object->setView( \TestHelperHtml::getView() );
25
+    }
26 26
 
27 27
 
28
-	protected function tearDown()
29
-	{
30
-		unset( $this->object );
31
-	}
28
+    protected function tearDown()
29
+    {
30
+        unset( $this->object );
31
+    }
32 32
 
33 33
 
34
-	public function testGetHeader()
35
-	{
36
-		$this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
34
+    public function testGetHeader()
35
+    {
36
+        $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
37 37
 
38
-		$output = $this->object->getHeader();
39
-		$this->assertNotNull( $output );
40
-	}
38
+        $output = $this->object->getHeader();
39
+        $this->assertNotNull( $output );
40
+    }
41 41
 
42 42
 
43
-	public function testGetHeaderException()
44
-	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
46
-			->setConstructorArgs( array( $this->context, array() ) )
47
-			->setMethods( array( 'setViewParams' ) )
48
-			->getMock();
43
+    public function testGetHeaderException()
44
+    {
45
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
46
+            ->setConstructorArgs( array( $this->context, array() ) )
47
+            ->setMethods( array( 'setViewParams' ) )
48
+            ->getMock();
49 49
 
50
-		$object->expects( $this->once() )->method( 'setViewParams' )
51
-			->will( $this->throwException( new \Exception() ) );
50
+        $object->expects( $this->once() )->method( 'setViewParams' )
51
+            ->will( $this->throwException( new \Exception() ) );
52 52
 
53
-		$object->setView( \TestHelperHtml::getView() );
53
+        $object->setView( \TestHelperHtml::getView() );
54 54
 
55
-		$this->assertEquals( null, $object->getHeader() );
56
-	}
55
+        $this->assertEquals( null, $object->getHeader() );
56
+    }
57 57
 
58 58
 
59
-	public function testGetBody()
60
-	{
61
-		$this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
59
+    public function testGetBody()
60
+    {
61
+        $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
62 62
 
63
-		$output = $this->object->getBody();
64
-		$this->assertStringStartsWith( '<section class="aimeos checkout-confirm">', $output );
65
-	}
63
+        $output = $this->object->getBody();
64
+        $this->assertStringStartsWith( '<section class="aimeos checkout-confirm">', $output );
65
+    }
66 66
 
67 67
 
68
-	public function testGetBodyHtmlException()
69
-	{
70
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
71
-			->setConstructorArgs( array( $this->context, array() ) )
72
-			->setMethods( array( 'setViewParams' ) )
73
-			->getMock();
68
+    public function testGetBodyHtmlException()
69
+    {
70
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
71
+            ->setConstructorArgs( array( $this->context, array() ) )
72
+            ->setMethods( array( 'setViewParams' ) )
73
+            ->getMock();
74 74
 
75
-		$object->expects( $this->once() )->method( 'setViewParams' )
76
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
75
+        $object->expects( $this->once() )->method( 'setViewParams' )
76
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
77 77
 
78
-		$object->setView( \TestHelperHtml::getView() );
78
+        $object->setView( \TestHelperHtml::getView() );
79 79
 
80
-		$this->assertContains( 'test exception', $object->getBody() );
81
-	}
80
+        $this->assertContains( 'test exception', $object->getBody() );
81
+    }
82 82
 
83 83
 
84
-	public function testGetBodyFrontendException()
85
-	{
86
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
87
-			->setConstructorArgs( array( $this->context, array() ) )
88
-			->setMethods( array( 'setViewParams' ) )
89
-			->getMock();
84
+    public function testGetBodyFrontendException()
85
+    {
86
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
87
+            ->setConstructorArgs( array( $this->context, array() ) )
88
+            ->setMethods( array( 'setViewParams' ) )
89
+            ->getMock();
90 90
 
91
-		$object->expects( $this->once() )->method( 'setViewParams' )
92
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
91
+        $object->expects( $this->once() )->method( 'setViewParams' )
92
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
93 93
 
94
-		$object->setView( \TestHelperHtml::getView() );
94
+        $object->setView( \TestHelperHtml::getView() );
95 95
 
96
-		$this->assertContains( 'test exception', $object->getBody() );
97
-	}
96
+        $this->assertContains( 'test exception', $object->getBody() );
97
+    }
98 98
 
99 99
 
100
-	public function testGetBodyMShopException()
101
-	{
102
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
103
-			->setConstructorArgs( array( $this->context, array() ) )
104
-			->setMethods( array( 'setViewParams' ) )
105
-			->getMock();
100
+    public function testGetBodyMShopException()
101
+    {
102
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
103
+            ->setConstructorArgs( array( $this->context, array() ) )
104
+            ->setMethods( array( 'setViewParams' ) )
105
+            ->getMock();
106 106
 
107
-		$object->expects( $this->once() )->method( 'setViewParams' )
108
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
107
+        $object->expects( $this->once() )->method( 'setViewParams' )
108
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
109 109
 
110
-		$object->setView( \TestHelperHtml::getView() );
110
+        $object->setView( \TestHelperHtml::getView() );
111 111
 
112
-		$this->assertContains( 'test exception', $object->getBody() );
113
-	}
112
+        $this->assertContains( 'test exception', $object->getBody() );
113
+    }
114 114
 
115 115
 
116
-	public function testGetBodyException()
117
-	{
118
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
119
-			->setConstructorArgs( array( $this->context, array() ) )
120
-			->setMethods( array( 'setViewParams' ) )
121
-			->getMock();
116
+    public function testGetBodyException()
117
+    {
118
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Confirm\Standard' )
119
+            ->setConstructorArgs( array( $this->context, array() ) )
120
+            ->setMethods( array( 'setViewParams' ) )
121
+            ->getMock();
122 122
 
123
-		$object->expects( $this->once() )->method( 'setViewParams' )
124
-			->will( $this->throwException( new \Exception() ) );
123
+        $object->expects( $this->once() )->method( 'setViewParams' )
124
+            ->will( $this->throwException( new \Exception() ) );
125 125
 
126
-		$object->setView( \TestHelperHtml::getView() );
126
+        $object->setView( \TestHelperHtml::getView() );
127 127
 
128
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
129
-	}
128
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
129
+    }
130 130
 
131 131
 
132
-	public function testGetSubClientInvalid()
133
-	{
134
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
135
-		$this->object->getSubClient( 'invalid', 'invalid' );
136
-	}
132
+    public function testGetSubClientInvalid()
133
+    {
134
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
135
+        $this->object->getSubClient( 'invalid', 'invalid' );
136
+    }
137 137
 
138 138
 
139
-	public function testGetSubClientInvalidName()
140
-	{
141
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
142
-		$this->object->getSubClient( '$$$', '$$$' );
143
-	}
139
+    public function testGetSubClientInvalidName()
140
+    {
141
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
142
+        $this->object->getSubClient( '$$$', '$$$' );
143
+    }
144 144
 
145 145
 
146
-	public function testProcess()
147
-	{
148
-		$this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
146
+    public function testProcess()
147
+    {
148
+        $this->context->getSession()->set( 'aimeos/orderid', $this->getOrder( '2011-09-17 16:14:32' )->getId() );
149 149
 
150
-		$view = $this->object->getView();
151
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'code' => 'paypalexpress' ) );
152
-		$view->addHelper( 'param', $helper );
150
+        $view = $this->object->getView();
151
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'code' => 'paypalexpress' ) );
152
+        $view->addHelper( 'param', $helper );
153 153
 
154
-		$view = $this->object->getView();
155
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
156
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
157
-		$view->addHelper( 'request', $helper );
154
+        $view = $this->object->getView();
155
+        $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
156
+        $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
157
+        $view->addHelper( 'request', $helper );
158 158
 
159
-		$this->object->process();
160
-	}
159
+        $this->object->process();
160
+    }
161 161
 
162 162
 
163
-	public function testProcessNoCode()
164
-	{
165
-		$this->object->process();
166
-	}
163
+    public function testProcessNoCode()
164
+    {
165
+        $this->object->process();
166
+    }
167 167
 
168 168
 
169
-	/**
170
-	 * @param string $date
171
-	 */
172
-	protected function getOrder( $date )
173
-	{
174
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context );
169
+    /**
170
+     * @param string $date
171
+     */
172
+    protected function getOrder( $date )
173
+    {
174
+        $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context );
175 175
 
176
-		$search = $orderManager->createSearch();
177
-		$search->setConditions( $search->compare( '==', 'order.datepayment', $date ) );
176
+        $search = $orderManager->createSearch();
177
+        $search->setConditions( $search->compare( '==', 'order.datepayment', $date ) );
178 178
 
179
-		$result = $orderManager->searchItems( $search );
179
+        $result = $orderManager->searchItems( $search );
180 180
 
181
-		if( ( $item = reset( $result ) ) === false ) {
182
-			throw new \Exception( 'No order found' );
183
-		}
181
+        if( ( $item = reset( $result ) ) === false ) {
182
+            throw new \Exception( 'No order found' );
183
+        }
184 184
 
185
-		return $item;
186
-	}
185
+        return $item;
186
+    }
187 187
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Checkout/Standard/StandardTest.php 1 patch
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -10,218 +10,218 @@
 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\Checkout\Standard\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Checkout\Standard\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\Checkout\Standard\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\Checkout\Standard\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
-		$view->standardStepActive = 'address';
56
+    public function testGetBody()
57
+    {
58
+        $view = $this->object->getView();
59
+        $view->standardStepActive = 'address';
60 60
 
61
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'c_step' => 'payment' ) );
62
-		$view->addHelper( 'param', $helper );
61
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'c_step' => 'payment' ) );
62
+        $view->addHelper( 'param', $helper );
63 63
 
64
-		$output = $this->object->getBody();
64
+        $output = $this->object->getBody();
65 65
 
66
-		$this->assertStringStartsWith( '<section class="aimeos checkout-standard">', $output );
67
-		$this->assertRegExp( '#<ol class="steps">.*<li class="step.*>.*</li>.*</ol>#smU', $output );
68
-		$this->assertContains( '<section class="checkout-standard-address', $output );
69
-		$this->assertNotContains( '<section class="checkout-standard-delivery', $output );
70
-		$this->assertNotContains( '<section class="checkout-standard-payment', $output );
71
-		$this->assertNotContains( '<section class="checkout-standard-summary', $output );
72
-		$this->assertNotContains( '<section class="checkout-standard-order', $output );
73
-	}
66
+        $this->assertStringStartsWith( '<section class="aimeos checkout-standard">', $output );
67
+        $this->assertRegExp( '#<ol class="steps">.*<li class="step.*>.*</li>.*</ol>#smU', $output );
68
+        $this->assertContains( '<section class="checkout-standard-address', $output );
69
+        $this->assertNotContains( '<section class="checkout-standard-delivery', $output );
70
+        $this->assertNotContains( '<section class="checkout-standard-payment', $output );
71
+        $this->assertNotContains( '<section class="checkout-standard-summary', $output );
72
+        $this->assertNotContains( '<section class="checkout-standard-order', $output );
73
+    }
74 74
 
75 75
 
76
-	public function testGetBodyOnepage()
77
-	{
78
-		$view = $this->object->getView();
76
+    public function testGetBodyOnepage()
77
+    {
78
+        $view = $this->object->getView();
79 79
 
80
-		$config = $this->context->getConfig();
81
-		$config->set( 'client/html/checkout/standard/onepage', array( 'address', 'delivery', 'payment', 'summary' ) );
80
+        $config = $this->context->getConfig();
81
+        $config->set( 'client/html/checkout/standard/onepage', array( 'address', 'delivery', 'payment', 'summary' ) );
82 82
 
83
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
84
-		$view->addHelper( 'config', $helper );
83
+        $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
84
+        $view->addHelper( 'config', $helper );
85 85
 
86
-		$output = $this->object->getBody();
86
+        $output = $this->object->getBody();
87 87
 
88
-		$this->assertContains( '<section class="checkout-standard-address', $output );
89
-		$this->assertContains( '<section class="checkout-standard-delivery', $output );
90
-		$this->assertContains( '<section class="checkout-standard-payment', $output );
91
-		$this->assertContains( '<section class="checkout-standard-summary', $output );
92
-		$this->assertNotContains( '<section class="checkout-standard-order', $output );
93
-	}
88
+        $this->assertContains( '<section class="checkout-standard-address', $output );
89
+        $this->assertContains( '<section class="checkout-standard-delivery', $output );
90
+        $this->assertContains( '<section class="checkout-standard-payment', $output );
91
+        $this->assertContains( '<section class="checkout-standard-summary', $output );
92
+        $this->assertNotContains( '<section class="checkout-standard-order', $output );
93
+    }
94 94
 
95 95
 
96
-	public function testGetBodyOnepagePartitial()
97
-	{
98
-		$view = $this->object->getView();
99
-		$view->standardStepActive = 'delivery';
96
+    public function testGetBodyOnepagePartitial()
97
+    {
98
+        $view = $this->object->getView();
99
+        $view->standardStepActive = 'delivery';
100 100
 
101
-		$config = $this->context->getConfig();
102
-		$config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) );
101
+        $config = $this->context->getConfig();
102
+        $config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) );
103 103
 
104
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
105
-		$view->addHelper( 'config', $helper );
104
+        $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
105
+        $view->addHelper( 'config', $helper );
106 106
 
107
-		$output = $this->object->getBody();
107
+        $output = $this->object->getBody();
108 108
 
109
-		$this->assertContains( '<section class="checkout-standard-delivery', $output );
110
-		$this->assertContains( '<section class="checkout-standard-payment', $output );
111
-		$this->assertNotContains( '<section class="checkout-standard-address', $output );
112
-		$this->assertNotContains( '<section class="checkout-standard-summary', $output );
113
-		$this->assertNotContains( '<section class="checkout-standard-order', $output );
114
-	}
109
+        $this->assertContains( '<section class="checkout-standard-delivery', $output );
110
+        $this->assertContains( '<section class="checkout-standard-payment', $output );
111
+        $this->assertNotContains( '<section class="checkout-standard-address', $output );
112
+        $this->assertNotContains( '<section class="checkout-standard-summary', $output );
113
+        $this->assertNotContains( '<section class="checkout-standard-order', $output );
114
+    }
115 115
 
116 116
 
117
-	public function testGetBodyOnepageDifferentStep()
118
-	{
119
-		$view = $this->object->getView();
120
-		$view->standardStepActive = 'address';
117
+    public function testGetBodyOnepageDifferentStep()
118
+    {
119
+        $view = $this->object->getView();
120
+        $view->standardStepActive = 'address';
121 121
 
122
-		$config = $this->context->getConfig();
123
-		$config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) );
122
+        $config = $this->context->getConfig();
123
+        $config->set( 'client/html/checkout/standard/onepage', array( 'delivery', 'payment' ) );
124 124
 
125
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
126
-		$view->addHelper( 'config', $helper );
125
+        $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
126
+        $view->addHelper( 'config', $helper );
127 127
 
128
-		$output = $this->object->getBody();
128
+        $output = $this->object->getBody();
129 129
 
130
-		$this->assertContains( '<section class="checkout-standard-address', $output );
131
-		$this->assertNotContains( '<section class="checkout-standard-delivery', $output );
132
-		$this->assertNotContains( '<section class="checkout-standard-payment', $output );
133
-		$this->assertNotContains( '<section class="checkout-standard-summary', $output );
134
-		$this->assertNotContains( '<section class="checkout-standard-order', $output );
135
-	}
130
+        $this->assertContains( '<section class="checkout-standard-address', $output );
131
+        $this->assertNotContains( '<section class="checkout-standard-delivery', $output );
132
+        $this->assertNotContains( '<section class="checkout-standard-payment', $output );
133
+        $this->assertNotContains( '<section class="checkout-standard-summary', $output );
134
+        $this->assertNotContains( '<section class="checkout-standard-order', $output );
135
+    }
136 136
 
137 137
 
138
-	public function testGetBodyHtmlException()
139
-	{
140
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
141
-			->setConstructorArgs( array( $this->context, array() ) )
142
-			->setMethods( array( 'setViewParams' ) )
143
-			->getMock();
138
+    public function testGetBodyHtmlException()
139
+    {
140
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
141
+            ->setConstructorArgs( array( $this->context, array() ) )
142
+            ->setMethods( array( 'setViewParams' ) )
143
+            ->getMock();
144 144
 
145
-		$object->expects( $this->once() )->method( 'setViewParams' )
146
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
145
+        $object->expects( $this->once() )->method( 'setViewParams' )
146
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
147 147
 
148
-		$object->setView( \TestHelperHtml::getView() );
148
+        $object->setView( \TestHelperHtml::getView() );
149 149
 
150
-		$this->assertContains( 'test exception', $object->getBody() );
151
-	}
150
+        $this->assertContains( 'test exception', $object->getBody() );
151
+    }
152 152
 
153 153
 
154
-	public function testGetBodyFrontendException()
155
-	{
156
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
157
-			->setConstructorArgs( array( $this->context, array() ) )
158
-			->setMethods( array( 'setViewParams' ) )
159
-			->getMock();
154
+    public function testGetBodyFrontendException()
155
+    {
156
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
157
+            ->setConstructorArgs( array( $this->context, array() ) )
158
+            ->setMethods( array( 'setViewParams' ) )
159
+            ->getMock();
160 160
 
161
-		$object->expects( $this->once() )->method( 'setViewParams' )
162
-			->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
161
+        $object->expects( $this->once() )->method( 'setViewParams' )
162
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
163 163
 
164
-		$object->setView( \TestHelperHtml::getView() );
164
+        $object->setView( \TestHelperHtml::getView() );
165 165
 
166
-		$this->assertContains( 'test exception', $object->getBody() );
167
-	}
166
+        $this->assertContains( 'test exception', $object->getBody() );
167
+    }
168 168
 
169 169
 
170
-	public function testGetBodyMShopException()
171
-	{
172
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
173
-			->setConstructorArgs( array( $this->context, array() ) )
174
-			->setMethods( array( 'setViewParams' ) )
175
-			->getMock();
170
+    public function testGetBodyMShopException()
171
+    {
172
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
173
+            ->setConstructorArgs( array( $this->context, array() ) )
174
+            ->setMethods( array( 'setViewParams' ) )
175
+            ->getMock();
176 176
 
177
-		$object->expects( $this->once() )->method( 'setViewParams' )
178
-			->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
177
+        $object->expects( $this->once() )->method( 'setViewParams' )
178
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
179 179
 
180
-		$object->setView( \TestHelperHtml::getView() );
180
+        $object->setView( \TestHelperHtml::getView() );
181 181
 
182
-		$this->assertContains( 'test exception', $object->getBody() );
183
-	}
182
+        $this->assertContains( 'test exception', $object->getBody() );
183
+    }
184 184
 
185 185
 
186
-	public function testGetBodyException()
187
-	{
188
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
189
-			->setConstructorArgs( array( $this->context, array() ) )
190
-			->setMethods( array( 'setViewParams' ) )
191
-			->getMock();
186
+    public function testGetBodyException()
187
+    {
188
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Standard\Standard' )
189
+            ->setConstructorArgs( array( $this->context, array() ) )
190
+            ->setMethods( array( 'setViewParams' ) )
191
+            ->getMock();
192 192
 
193
-		$object->expects( $this->once() )->method( 'setViewParams' )
194
-			->will( $this->throwException( new \Exception() ) );
193
+        $object->expects( $this->once() )->method( 'setViewParams' )
194
+            ->will( $this->throwException( new \Exception() ) );
195 195
 
196
-		$object->setView( \TestHelperHtml::getView() );
196
+        $object->setView( \TestHelperHtml::getView() );
197 197
 
198
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
199
-	}
198
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
199
+    }
200 200
 
201 201
 
202
-	public function testGetSubClient()
203
-	{
204
-		$client = $this->object->getSubClient( 'address', 'Standard' );
205
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
206
-	}
202
+    public function testGetSubClient()
203
+    {
204
+        $client = $this->object->getSubClient( 'address', 'Standard' );
205
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
206
+    }
207 207
 
208 208
 
209
-	public function testGetSubClientInvalid()
210
-	{
211
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
212
-		$this->object->getSubClient( 'invalid', 'invalid' );
213
-	}
209
+    public function testGetSubClientInvalid()
210
+    {
211
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
212
+        $this->object->getSubClient( 'invalid', 'invalid' );
213
+    }
214 214
 
215 215
 
216
-	public function testGetSubClientInvalidName()
217
-	{
218
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
219
-		$this->object->getSubClient( '$$$', '$$$' );
220
-	}
216
+    public function testGetSubClientInvalidName()
217
+    {
218
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
219
+        $this->object->getSubClient( '$$$', '$$$' );
220
+    }
221 221
 
222 222
 
223
-	public function testProcess()
224
-	{
225
-		$this->object->process();
226
-	}
223
+    public function testProcess()
224
+    {
225
+        $this->object->process();
226
+    }
227 227
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Checkout/Update/StandardTest.php 1 patch
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -10,180 +10,180 @@
 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
-		$paths = \TestHelperHtml::getHtmlTemplatePaths();
20
-		$this->context = \TestHelperHtml::getContext();
17
+    protected function setUp()
18
+    {
19
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
20
+        $this->context = \TestHelperHtml::getContext();
21 21
 
22
-		$this->object = new \Aimeos\Client\Html\Checkout\Update\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
22
+        $this->object = new \Aimeos\Client\Html\Checkout\Update\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\Checkout\Update\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\Checkout\Update\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
-		$this->assertEquals( '', $this->object->getBody() );
59
-	}
56
+    public function testGetBody()
57
+    {
58
+        $this->assertEquals( '', $this->object->getBody() );
59
+    }
60 60
 
61 61
 
62
-	public function testGetBodyHtmlException()
63
-	{
64
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' )
65
-			->setConstructorArgs( array( $this->context, array() ) )
66
-			->setMethods( array( 'setViewParams' ) )
67
-			->getMock();
62
+    public function testGetBodyHtmlException()
63
+    {
64
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' )
65
+            ->setConstructorArgs( array( $this->context, array() ) )
66
+            ->setMethods( array( 'setViewParams' ) )
67
+            ->getMock();
68 68
 
69
-		$object->expects( $this->once() )->method( 'setViewParams' )
70
-			->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
69
+        $object->expects( $this->once() )->method( 'setViewParams' )
70
+            ->will( $this->throwException( new \Aimeos\Client\Html\Exception( 'test exception' ) ) );
71 71
 
72
-		$object->setView( \TestHelperHtml::getView() );
72
+        $object->setView( \TestHelperHtml::getView() );
73 73
 
74
-		$object->getBody();
75
-	}
74
+        $object->getBody();
75
+    }
76 76
 
77 77
 
78
-	public function testGetBodyFrontendException()
79
-	{
80
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' )
81
-			->setConstructorArgs( array( $this->context, array() ) )
82
-			->setMethods( array( 'setViewParams' ) )
83
-			->getMock();
78
+    public function testGetBodyFrontendException()
79
+    {
80
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\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\Controller\Frontend\Exception( 'test exception' ) ) );
85
+        $object->expects( $this->once() )->method( 'setViewParams' )
86
+            ->will( $this->throwException( new \Aimeos\Controller\Frontend\Exception( 'test exception' ) ) );
87 87
 
88
-		$object->setView( \TestHelperHtml::getView() );
88
+        $object->setView( \TestHelperHtml::getView() );
89 89
 
90
-		$object->getBody();
91
-	}
90
+        $object->getBody();
91
+    }
92 92
 
93 93
 
94
-	public function testGetBodyMShopException()
95
-	{
96
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' )
97
-			->setConstructorArgs( array( $this->context, array() ) )
98
-			->setMethods( array( 'setViewParams' ) )
99
-			->getMock();
94
+    public function testGetBodyMShopException()
95
+    {
96
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\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\MShop\Exception( 'test exception' ) ) );
101
+        $object->expects( $this->once() )->method( 'setViewParams' )
102
+            ->will( $this->throwException( new \Aimeos\MShop\Exception( 'test exception' ) ) );
103 103
 
104
-		$object->setView( \TestHelperHtml::getView() );
104
+        $object->setView( \TestHelperHtml::getView() );
105 105
 
106
-		$object->getBody();
107
-	}
106
+        $object->getBody();
107
+    }
108 108
 
109 109
 
110
-	public function testGetBodyException()
111
-	{
112
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\Standard' )
113
-			->setConstructorArgs( array( $this->context, array() ) )
114
-			->setMethods( array( 'setViewParams' ) )
115
-			->getMock();
110
+    public function testGetBodyException()
111
+    {
112
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Checkout\Update\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 \Exception() ) );
117
+        $object->expects( $this->once() )->method( 'setViewParams' )
118
+            ->will( $this->throwException( new \Exception() ) );
119 119
 
120
-		$object->setView( \TestHelperHtml::getView() );
120
+        $object->setView( \TestHelperHtml::getView() );
121 121
 
122
-		$object->getBody();
123
-	}
122
+        $object->getBody();
123
+    }
124 124
 
125 125
 
126
-	public function testGetSubClientInvalid()
127
-	{
128
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
129
-		$this->object->getSubClient( 'invalid', 'invalid' );
130
-	}
126
+    public function testGetSubClientInvalid()
127
+    {
128
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
129
+        $this->object->getSubClient( 'invalid', 'invalid' );
130
+    }
131 131
 
132 132
 
133
-	public function testGetSubClientInvalidName()
134
-	{
135
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
136
-		$this->object->getSubClient( '$$$', '$$$' );
137
-	}
133
+    public function testGetSubClientInvalidName()
134
+    {
135
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
136
+        $this->object->getSubClient( '$$$', '$$$' );
137
+    }
138 138
 
139 139
 
140
-	public function testProcess()
141
-	{
142
-		$params = array(
143
-			'code' => 'paypalexpress',
144
-			'orderid' => $this->getOrder( '2011-09-17 16:14:32' )->getId(),
145
-		);
140
+    public function testProcess()
141
+    {
142
+        $params = array(
143
+            'code' => 'paypalexpress',
144
+            'orderid' => $this->getOrder( '2011-09-17 16:14:32' )->getId(),
145
+        );
146 146
 
147
-		$view = $this->object->getView();
148
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
149
-		$view->addHelper( 'param', $helper );
147
+        $view = $this->object->getView();
148
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
149
+        $view->addHelper( 'param', $helper );
150 150
 
151
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
152
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
153
-		$view->addHelper( 'request', $helper );
151
+        $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
152
+        $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
153
+        $view->addHelper( 'request', $helper );
154 154
 
155
-		$this->object->process();
156
-	}
155
+        $this->object->process();
156
+    }
157 157
 
158 158
 
159
-	public function testProcessNoService()
160
-	{
161
-		$view = $this->object->getView();
159
+    public function testProcessNoService()
160
+    {
161
+        $view = $this->object->getView();
162 162
 
163
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
164
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
165
-		$view->addHelper( 'request', $helper );
163
+        $request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
164
+        $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, $request, '127.0.0.1', 'test' );
165
+        $view->addHelper( 'request', $helper );
166 166
 
167
-		$this->object->process();
168
-	}
167
+        $this->object->process();
168
+    }
169 169
 
170 170
 
171
-	/**
172
-	 * @param string $date
173
-	 */
174
-	protected function getOrder( $date )
175
-	{
176
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context );
171
+    /**
172
+     * @param string $date
173
+     */
174
+    protected function getOrder( $date )
175
+    {
176
+        $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $this->context );
177 177
 
178
-		$search = $orderManager->createSearch();
179
-		$search->setConditions( $search->compare( '==', 'order.datepayment', $date ) );
178
+        $search = $orderManager->createSearch();
179
+        $search->setConditions( $search->compare( '==', 'order.datepayment', $date ) );
180 180
 
181
-		$result = $orderManager->searchItems( $search );
181
+        $result = $orderManager->searchItems( $search );
182 182
 
183
-		if( ( $item = reset( $result ) ) === false ) {
184
-			throw new \Exception( 'No order found' );
185
-		}
183
+        if( ( $item = reset( $result ) ) === false ) {
184
+            throw new \Exception( 'No order found' );
185
+        }
186 186
 
187
-		return $item;
188
-	}
187
+        return $item;
188
+    }
189 189
 }
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Account/Favorite/StandardTest.php 1 patch
Indentation   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -10,219 +10,219 @@
 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\Account\Favorite\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Account\Favorite\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\Account\Favorite\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\Account\Favorite\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 account-favorite">', $output );
60
-	}
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59
+        $this->assertStringStartsWith( '<section class="aimeos account-favorite">', $output );
60
+    }
61 61
 
62 62
 
63
-	public function testGetBodyHtmlException()
64
-	{
65
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Favorite\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\Account\Favorite\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\Account\Favorite\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\Account\Favorite\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\Account\Favorite\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\Account\Favorite\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 testGetBodyException()
112
-	{
113
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Favorite\Standard' )
114
-			->setConstructorArgs( array( $this->context, array() ) )
115
-			->setMethods( array( 'setViewParams' ) )
116
-			->getMock();
111
+    public function testGetBodyException()
112
+    {
113
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Favorite\Standard' )
114
+            ->setConstructorArgs( array( $this->context, array() ) )
115
+            ->setMethods( array( 'setViewParams' ) )
116
+            ->getMock();
117 117
 
118
-		$object->expects( $this->once() )->method( 'setViewParams' )
119
-			->will( $this->throwException( new \Exception() ) );
118
+        $object->expects( $this->once() )->method( 'setViewParams' )
119
+            ->will( $this->throwException( new \Exception() ) );
120 120
 
121
-		$object->setView( \TestHelperHtml::getView() );
121
+        $object->setView( \TestHelperHtml::getView() );
122 122
 
123
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
124
-	}
123
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
124
+    }
125 125
 
126 126
 
127
-	public function testGetSubClientInvalid()
128
-	{
129
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
130
-		$this->object->getSubClient( 'invalid', 'invalid' );
131
-	}
127
+    public function testGetSubClientInvalid()
128
+    {
129
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
130
+        $this->object->getSubClient( 'invalid', 'invalid' );
131
+    }
132 132
 
133 133
 
134
-	public function testGetSubClientInvalidName()
135
-	{
136
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
137
-		$this->object->getSubClient( '$$$', '$$$' );
138
-	}
134
+    public function testGetSubClientInvalidName()
135
+    {
136
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
137
+        $this->object->getSubClient( '$$$', '$$$' );
138
+    }
139 139
 
140 140
 
141
-	public function testProcess()
142
-	{
143
-		$this->object->process();
144
-	}
141
+    public function testProcess()
142
+    {
143
+        $this->object->process();
144
+    }
145 145
 
146 146
 
147
-	public function testProcessAddItem()
148
-	{
149
-		$this->context->setUserId( '123' );
147
+    public function testProcessAddItem()
148
+    {
149
+        $this->context->setUserId( '123' );
150 150
 
151
-		$view = $this->object->getView();
152
-		$param = array(
153
-			'fav_action' => 'add',
154
-			'fav_id' => 321,
155
-		);
151
+        $view = $this->object->getView();
152
+        $param = array(
153
+            'fav_action' => 'add',
154
+            'fav_id' => 321,
155
+        );
156 156
 
157
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
158
-		$view->addHelper( 'param', $helper );
157
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
158
+        $view->addHelper( 'param', $helper );
159 159
 
160 160
 
161 161
 
162
-		$listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
163
-			->setMethods( array( 'saveItem', 'moveItem' ) )
164
-			->setConstructorArgs( array( $this->context ) )
165
-			->getMock();
162
+        $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
163
+            ->setMethods( array( 'saveItem', 'moveItem' ) )
164
+            ->setConstructorArgs( array( $this->context ) )
165
+            ->getMock();
166 166
 
167
-		$managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
168
-			->setMethods( array( 'getSubManager' ) )
169
-			->setConstructorArgs( array( $this->context ) )
170
-			->getMock();
167
+        $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
168
+            ->setMethods( array( 'getSubManager' ) )
169
+            ->setConstructorArgs( array( $this->context ) )
170
+            ->getMock();
171 171
 
172
-		$name = 'ClientHtmlAccountFavoriteDefaultProcess';
173
-		$this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
172
+        $name = 'ClientHtmlAccountFavoriteDefaultProcess';
173
+        $this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
174 174
 
175
-		\Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
175
+        \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
176 176
 
177 177
 
178
-		$managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
179
-			->will( $this->returnValue( $listManagerStub ) );
178
+        $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
179
+            ->will( $this->returnValue( $listManagerStub ) );
180 180
 
181
-		$listManagerStub->expects( $this->once() )->method( 'saveItem' );
182
-		$listManagerStub->expects( $this->once() )->method( 'moveItem' );
181
+        $listManagerStub->expects( $this->once() )->method( 'saveItem' );
182
+        $listManagerStub->expects( $this->once() )->method( 'moveItem' );
183 183
 
184 184
 
185
-		$this->object->process();
186
-	}
185
+        $this->object->process();
186
+    }
187 187
 
188 188
 
189
-	public function testProcessDeleteItem()
190
-	{
191
-		$this->context->setUserId( '123' );
189
+    public function testProcessDeleteItem()
190
+    {
191
+        $this->context->setUserId( '123' );
192 192
 
193
-		$view = $this->object->getView();
194
-		$param = array(
195
-			'fav_action' => 'delete',
196
-			'fav_id' => 321,
197
-		);
193
+        $view = $this->object->getView();
194
+        $param = array(
195
+            'fav_action' => 'delete',
196
+            'fav_id' => 321,
197
+        );
198 198
 
199
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
200
-		$view->addHelper( 'param', $helper );
199
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
200
+        $view->addHelper( 'param', $helper );
201 201
 
202 202
 
203 203
 
204
-		$listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
205
-			->setMethods( array( 'deleteItems' ) )
206
-			->setConstructorArgs( array( $this->context ) )
207
-			->getMock();
204
+        $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
205
+            ->setMethods( array( 'deleteItems' ) )
206
+            ->setConstructorArgs( array( $this->context ) )
207
+            ->getMock();
208 208
 
209
-		$managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
210
-			->setMethods( array( 'getSubManager' ) )
211
-			->setConstructorArgs( array( $this->context ) )
212
-			->getMock();
209
+        $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
210
+            ->setMethods( array( 'getSubManager' ) )
211
+            ->setConstructorArgs( array( $this->context ) )
212
+            ->getMock();
213 213
 
214
-		$name = 'ClientHtmlAccountFavoriteDefaultProcess';
215
-		$this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
214
+        $name = 'ClientHtmlAccountFavoriteDefaultProcess';
215
+        $this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
216 216
 
217
-		\Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
217
+        \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
218 218
 
219 219
 
220
-		$managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
221
-			->will( $this->returnValue( $listManagerStub ) );
220
+        $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
221
+            ->will( $this->returnValue( $listManagerStub ) );
222 222
 
223
-		$listManagerStub->expects( $this->once() )->method( 'deleteItems' );
223
+        $listManagerStub->expects( $this->once() )->method( 'deleteItems' );
224 224
 
225 225
 
226
-		$this->object->process();
227
-	}
226
+        $this->object->process();
227
+    }
228 228
 }
229 229
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Account/History/StandardTest.php 1 patch
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -10,143 +10,143 @@
 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\Account\History\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Account\History\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\Account\History\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\Account\History\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 account-history">', $output );
60
-	}
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59
+        $this->assertStringStartsWith( '<section class="aimeos account-history">', $output );
60
+    }
61 61
 
62 62
 
63
-	public function testGetBodyHtmlException()
64
-	{
65
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\History\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\Account\History\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\Account\History\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\Account\History\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\Account\History\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\Account\History\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 testGetBodyException()
112
-	{
113
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\History\Standard' )
114
-			->setConstructorArgs( array( $this->context, array() ) )
115
-			->setMethods( array( 'setViewParams' ) )
116
-			->getMock();
111
+    public function testGetBodyException()
112
+    {
113
+        $object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\History\Standard' )
114
+            ->setConstructorArgs( array( $this->context, array() ) )
115
+            ->setMethods( array( 'setViewParams' ) )
116
+            ->getMock();
117 117
 
118
-		$object->expects( $this->once() )->method( 'setViewParams' )
119
-			->will( $this->throwException( new \Exception() ) );
118
+        $object->expects( $this->once() )->method( 'setViewParams' )
119
+            ->will( $this->throwException( new \Exception() ) );
120 120
 
121
-		$object->setView( \TestHelperHtml::getView() );
121
+        $object->setView( \TestHelperHtml::getView() );
122 122
 
123
-		$this->assertContains( 'A non-recoverable error occured', $object->getBody() );
124
-	}
123
+        $this->assertContains( 'A non-recoverable error occured', $object->getBody() );
124
+    }
125 125
 
126 126
 
127
-	public function testGetSubClient()
128
-	{
129
-		$client = $this->object->getSubClient( 'lists', 'Standard' );
130
-		$this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
131
-	}
127
+    public function testGetSubClient()
128
+    {
129
+        $client = $this->object->getSubClient( 'lists', 'Standard' );
130
+        $this->assertInstanceOf( '\\Aimeos\\Client\\HTML\\Iface', $client );
131
+    }
132 132
 
133 133
 
134
-	public function testGetSubClientInvalid()
135
-	{
136
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
137
-		$this->object->getSubClient( 'invalid', 'invalid' );
138
-	}
134
+    public function testGetSubClientInvalid()
135
+    {
136
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
137
+        $this->object->getSubClient( 'invalid', 'invalid' );
138
+    }
139 139
 
140 140
 
141
-	public function testGetSubClientInvalidName()
142
-	{
143
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
144
-		$this->object->getSubClient( '$$$', '$$$' );
145
-	}
141
+    public function testGetSubClientInvalidName()
142
+    {
143
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
144
+        $this->object->getSubClient( '$$$', '$$$' );
145
+    }
146 146
 
147 147
 
148
-	public function testProcess()
149
-	{
150
-		$this->object->process();
151
-	}
148
+    public function testProcess()
149
+    {
150
+        $this->object->process();
151
+    }
152 152
 }
153 153
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/tests/Client/Html/Account/Watch/StandardTest.php 1 patch
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -10,249 +10,249 @@
 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\Account\Watch\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
24
-	}
21
+        $paths = \TestHelperHtml::getHtmlTemplatePaths();
22
+        $this->object = new \Aimeos\Client\Html\Account\Watch\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\Account\Watch\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\Account\Watch\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 account-watch">', $output );
60
-	}
56
+    public function testGetBody()
57
+    {
58
+        $output = $this->object->getBody();
59
+        $this->assertStringStartsWith( '<section class="aimeos account-watch">', $output );
60
+    }
61 61
 
62 62
 
63
-	public function testGetBodyHtmlException()
64
-	{
65
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Account\Watch\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\Account\Watch\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\Account\Watch\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\Account\Watch\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\Account\Watch\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\Account\Watch\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 testGetSubClientInvalid()
112
-	{
113
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
114
-		$this->object->getSubClient( 'invalid', 'invalid' );
115
-	}
111
+    public function testGetSubClientInvalid()
112
+    {
113
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
114
+        $this->object->getSubClient( 'invalid', 'invalid' );
115
+    }
116 116
 
117 117
 
118
-	public function testGetSubClientInvalidName()
119
-	{
120
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
121
-		$this->object->getSubClient( '$$$', '$$$' );
122
-	}
118
+    public function testGetSubClientInvalidName()
119
+    {
120
+        $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
121
+        $this->object->getSubClient( '$$$', '$$$' );
122
+    }
123 123
 
124 124
 
125
-	public function testProcess()
126
-	{
127
-		$this->object->process();
128
-	}
125
+    public function testProcess()
126
+    {
127
+        $this->object->process();
128
+    }
129 129
 
130 130
 
131
-	public function testProcessAddItem()
132
-	{
133
-		$this->context->setUserId( '123' );
131
+    public function testProcessAddItem()
132
+    {
133
+        $this->context->setUserId( '123' );
134 134
 
135
-		$view = $this->object->getView();
136
-		$param = array(
137
-			'wat_action' => 'add',
138
-			'wat_id' => 321,
139
-		);
135
+        $view = $this->object->getView();
136
+        $param = array(
137
+            'wat_action' => 'add',
138
+            'wat_id' => 321,
139
+        );
140 140
 
141
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
142
-		$view->addHelper( 'param', $helper );
141
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
142
+        $view->addHelper( 'param', $helper );
143 143
 
144 144
 
145 145
 
146
-		$listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
147
-			->setMethods( array( 'saveItem', 'moveItem' ) )
148
-			->setConstructorArgs( array( $this->context ) )
149
-			->getMock();
146
+        $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
147
+            ->setMethods( array( 'saveItem', 'moveItem' ) )
148
+            ->setConstructorArgs( array( $this->context ) )
149
+            ->getMock();
150 150
 
151
-		$managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
152
-			->setMethods( array( 'getSubManager' ) )
153
-			->setConstructorArgs( array( $this->context ) )
154
-			->getMock();
151
+        $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
152
+            ->setMethods( array( 'getSubManager' ) )
153
+            ->setConstructorArgs( array( $this->context ) )
154
+            ->getMock();
155 155
 
156
-		$name = 'ClientHtmlAccountWatchDefaultProcess';
157
-		$this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
156
+        $name = 'ClientHtmlAccountWatchDefaultProcess';
157
+        $this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
158 158
 
159
-		\Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
159
+        \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
160 160
 
161 161
 
162
-		$managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
163
-			->will( $this->returnValue( $listManagerStub ) );
162
+        $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
163
+            ->will( $this->returnValue( $listManagerStub ) );
164 164
 
165
-		$listManagerStub->expects( $this->once() )->method( 'saveItem' );
166
-		$listManagerStub->expects( $this->once() )->method( 'moveItem' );
165
+        $listManagerStub->expects( $this->once() )->method( 'saveItem' );
166
+        $listManagerStub->expects( $this->once() )->method( 'moveItem' );
167 167
 
168 168
 
169
-		$this->object->process();
170
-	}
169
+        $this->object->process();
170
+    }
171 171
 
172 172
 
173
-	public function testProcessEditItem()
174
-	{
175
-		$this->context->setUserId( '123' );
173
+    public function testProcessEditItem()
174
+    {
175
+        $this->context->setUserId( '123' );
176 176
 
177
-		$view = $this->object->getView();
178
-		$param = array(
179
-			'wat_action' => 'edit',
180
-			'wat_id' => 321,
181
-		);
177
+        $view = $this->object->getView();
178
+        $param = array(
179
+            'wat_action' => 'edit',
180
+            'wat_id' => 321,
181
+        );
182 182
 
183
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
184
-		$view->addHelper( 'param', $helper );
183
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
184
+        $view->addHelper( 'param', $helper );
185 185
 
186 186
 
187
-		$listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
188
-			->setMethods( array( 'saveItem', 'searchItems' ) )
189
-			->setConstructorArgs( array( $this->context ) )
190
-			->getMock();
187
+        $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
188
+            ->setMethods( array( 'saveItem', 'searchItems' ) )
189
+            ->setConstructorArgs( array( $this->context ) )
190
+            ->getMock();
191 191
 
192
-		$managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
193
-			->setMethods( array( 'getSubManager' ) )
194
-			->setConstructorArgs( array( $this->context ) )
195
-			->getMock();
192
+        $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
193
+            ->setMethods( array( 'getSubManager' ) )
194
+            ->setConstructorArgs( array( $this->context ) )
195
+            ->getMock();
196 196
 
197
-		$name = 'ClientHtmlAccountWatchDefaultProcess';
198
-		$this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
197
+        $name = 'ClientHtmlAccountWatchDefaultProcess';
198
+        $this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
199 199
 
200
-		\Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
200
+        \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
201 201
 
202 202
 
203
-		$item = $listManagerStub->createItem();
204
-		$item->setRefId( 321 );
203
+        $item = $listManagerStub->createItem();
204
+        $item->setRefId( 321 );
205 205
 
206
-		$managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
207
-			->will( $this->returnValue( $listManagerStub ) );
206
+        $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
207
+            ->will( $this->returnValue( $listManagerStub ) );
208 208
 
209
-		$listManagerStub->expects( $this->once() )->method( 'searchItems' )
210
-			->will( $this->returnValue( array( $item ) ) );
209
+        $listManagerStub->expects( $this->once() )->method( 'searchItems' )
210
+            ->will( $this->returnValue( array( $item ) ) );
211 211
 
212
-		$listManagerStub->expects( $this->once() )->method( 'saveItem' );
212
+        $listManagerStub->expects( $this->once() )->method( 'saveItem' );
213 213
 
214 214
 
215
-		$this->object->process();
216
-	}
215
+        $this->object->process();
216
+    }
217 217
 
218 218
 
219
-	public function testProcessDeleteItem()
220
-	{
221
-		$this->context->setUserId( '123' );
219
+    public function testProcessDeleteItem()
220
+    {
221
+        $this->context->setUserId( '123' );
222 222
 
223
-		$view = $this->object->getView();
224
-		$param = array(
225
-			'wat_action' => 'delete',
226
-			'wat_id' => 321,
227
-		);
223
+        $view = $this->object->getView();
224
+        $param = array(
225
+            'wat_action' => 'delete',
226
+            'wat_id' => 321,
227
+        );
228 228
 
229
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
230
-		$view->addHelper( 'param', $helper );
229
+        $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
230
+        $view->addHelper( 'param', $helper );
231 231
 
232 232
 
233 233
 
234
-		$listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
235
-			->setMethods( array( 'deleteItems' ) )
236
-			->setConstructorArgs( array( $this->context ) )
237
-			->getMock();
234
+        $listManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard' )
235
+            ->setMethods( array( 'deleteItems' ) )
236
+            ->setConstructorArgs( array( $this->context ) )
237
+            ->getMock();
238 238
 
239
-		$managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
240
-			->setMethods( array( 'getSubManager' ) )
241
-			->setConstructorArgs( array( $this->context ) )
242
-			->getMock();
239
+        $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
240
+            ->setMethods( array( 'getSubManager' ) )
241
+            ->setConstructorArgs( array( $this->context ) )
242
+            ->getMock();
243 243
 
244
-		$name = 'ClientHtmlAccountWatchDefaultProcess';
245
-		$this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
244
+        $name = 'ClientHtmlAccountWatchDefaultProcess';
245
+        $this->context->getConfig()->set( 'mshop/customer/manager/name', $name );
246 246
 
247
-		\Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
247
+        \Aimeos\MShop\Customer\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Customer\\Manager\\' . $name, $managerStub );
248 248
 
249 249
 
250
-		$managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
251
-			->will( $this->returnValue( $listManagerStub ) );
250
+        $managerStub->expects( $this->atLeastOnce() )->method( 'getSubManager' )
251
+            ->will( $this->returnValue( $listManagerStub ) );
252 252
 
253
-		$listManagerStub->expects( $this->once() )->method( 'deleteItems' );
253
+        $listManagerStub->expects( $this->once() )->method( 'deleteItems' );
254 254
 
255 255
 
256
-		$this->object->process();
257
-	}
256
+        $this->object->process();
257
+    }
258 258
 }
259 259
\ No newline at end of file
Please login to merge, or discard this patch.