Completed
Push — master ( ea7c09...15cf0d )
by Aimeos
06:26
created
client/html/tests/Client/Html/Catalog/Suggest/StandardTest.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,79 +19,79 @@
 block discarded – undo
19 19
 		$this->context = \TestHelperHtml::getContext();
20 20
 
21 21
 		$paths = \TestHelperHtml::getHtmlTemplatePaths();
22
-		$this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths );
23
-		$this->object->setView( \TestHelperHtml::getView() );
22
+		$this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard($this->context, $paths);
23
+		$this->object->setView(\TestHelperHtml::getView());
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		unset( $this->object );
29
+		unset($this->object);
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testGetHeader()
34 34
 	{
35 35
 		$output = $this->object->getHeader();
36
-		$this->assertNotNull( $output );
36
+		$this->assertNotNull($output);
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testGetHeaderException()
41 41
 	{
42
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
43
-			->setConstructorArgs( array( $this->context, array() ) )
44
-			->setMethods( array( 'setViewParams' ) )
42
+		$object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Suggest\Standard')
43
+			->setConstructorArgs(array($this->context, array()))
44
+			->setMethods(array('setViewParams'))
45 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() );
52
+		$this->assertEquals(null, $object->getHeader());
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testGetBody()
57 57
 	{
58 58
 		$view = $this->object->getView();
59
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) );
60
-		$view->addHelper( 'param', $helper );
59
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, array('f_search' => 'Unterpro'));
60
+		$view->addHelper('param', $helper);
61 61
 
62 62
 		$output = $this->object->getBody();
63 63
 
64
-		$this->assertNotEquals( array(), $this->object->getView()->suggestTextItems );
65
-		$this->assertRegExp( '#"id":.*,"name":"Unterpro.*","url":"<a#smU', $output );
64
+		$this->assertNotEquals(array(), $this->object->getView()->suggestTextItems);
65
+		$this->assertRegExp('#"id":.*,"name":"Unterpro.*","url":"<a#smU', $output);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGetBodyException()
70 70
 	{
71
-		$object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' )
72
-			->setConstructorArgs( array( $this->context, array() ) )
73
-			->setMethods( array( 'setViewParams' ) )
71
+		$object = $this->getMockBuilder('\Aimeos\Client\Html\Catalog\Suggest\Standard')
72
+			->setConstructorArgs(array($this->context, array()))
73
+			->setMethods(array('setViewParams'))
74 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() );
81
+		$this->assertEquals(null, $object->getBody());
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testGetSubClientInvalid()
86 86
 	{
87
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
88
-		$this->object->getSubClient( 'invalid', 'invalid' );
87
+		$this->setExpectedException('\\Aimeos\\Client\\Html\\Exception');
88
+		$this->object->getSubClient('invalid', 'invalid');
89 89
 	}
90 90
 
91 91
 
92 92
 	public function testGetSubClientInvalidName()
93 93
 	{
94
-		$this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' );
95
-		$this->object->getSubClient( '$$$', '$$$' );
94
+		$this->setExpectedException('\\Aimeos\\Client\\Html\\Exception');
95
+		$this->object->getSubClient('$$$', '$$$');
96 96
 	}
97 97
 }
98 98
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/templates/catalog/suggest/body-default.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,23 +6,23 @@
 block discarded – undo
6 6
  * @copyright Aimeos (aimeos.org), 2015-2016
7 7
  */
8 8
 
9
-$target = $this->config( 'client/html/catalog/detail/url/target' );
10
-$cntl = $this->config( 'client/html/catalog/detail/url/controller', 'catalog' );
11
-$action = $this->config( 'client/html/catalog/detail/url/action', 'detail' );
12
-$config = $this->config( 'client/html/catalog/detail/url/config', array() );
9
+$target = $this->config('client/html/catalog/detail/url/target');
10
+$cntl = $this->config('client/html/catalog/detail/url/controller', 'catalog');
11
+$action = $this->config('client/html/catalog/detail/url/action', 'detail');
12
+$config = $this->config('client/html/catalog/detail/url/config', array());
13 13
 
14 14
 $suggestTextItems = array();
15 15
 $template = '<a class="suggest-item" href="%1$s">%2$s</a>';
16 16
 
17
-foreach( $this->get( 'suggestTextItems', array() ) as $id => $name )
17
+foreach ($this->get('suggestTextItems', array()) as $id => $name)
18 18
 {
19
-	$url = $this->url( $target, $cntl, $action, array( 'd_prodid' => $id ), array(), $config );
20
-	$suggestTextItems[] = array( 'id' => $id, 'name' => $name, 'url' => sprintf( $template, $url, $name ) );
19
+	$url = $this->url($target, $cntl, $action, array('d_prodid' => $id), array(), $config);
20
+	$suggestTextItems[] = array('id' => $id, 'name' => $name, 'url' => sprintf($template, $url, $name));
21 21
 }
22 22
 
23 23
 ?>
24
-<?php $this->block()->start( 'catalog/suggest' ); ?>
25
-<?php echo json_encode( $suggestTextItems ); ?>
26
-<?php echo $this->get( 'suggestBody' ); ?>
24
+<?php $this->block()->start('catalog/suggest'); ?>
25
+<?php echo json_encode($suggestTextItems); ?>
26
+<?php echo $this->get('suggestBody'); ?>
27 27
 <?php $this->block()->stop(); ?>
28
-<?php echo $this->block()->get( 'catalog/suggest' ); ?>
28
+<?php echo $this->block()->get('catalog/suggest'); ?>
Please login to merge, or discard this patch.