@@ -10,88 +10,88 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class StandardTest extends \PHPUnit_Framework_TestCase |
| 12 | 12 | { |
| 13 | - private $object; |
|
| 14 | - private $context; |
|
| 13 | + private $object; |
|
| 14 | + private $context; |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | - protected function setUp() |
|
| 18 | - { |
|
| 19 | - $this->context = \TestHelperHtml::getContext(); |
|
| 17 | + protected function setUp() |
|
| 18 | + { |
|
| 19 | + $this->context = \TestHelperHtml::getContext(); |
|
| 20 | 20 | |
| 21 | - $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
|
| 22 | - $this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths ); |
|
| 23 | - $this->object->setView( \TestHelperHtml::getView() ); |
|
| 24 | - } |
|
| 21 | + $paths = \TestHelperHtml::getHtmlTemplatePaths(); |
|
| 22 | + $this->object = new \Aimeos\Client\Html\Catalog\Suggest\Standard( $this->context, $paths ); |
|
| 23 | + $this->object->setView( \TestHelperHtml::getView() ); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | - protected function tearDown() |
|
| 28 | - { |
|
| 29 | - unset( $this->object ); |
|
| 30 | - } |
|
| 27 | + protected function tearDown() |
|
| 28 | + { |
|
| 29 | + unset( $this->object ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - public function testGetHeader() |
|
| 34 | - { |
|
| 35 | - $output = $this->object->getHeader(); |
|
| 36 | - $this->assertNotNull( $output ); |
|
| 37 | - } |
|
| 33 | + public function testGetHeader() |
|
| 34 | + { |
|
| 35 | + $output = $this->object->getHeader(); |
|
| 36 | + $this->assertNotNull( $output ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | - public function testGetHeaderException() |
|
| 41 | - { |
|
| 42 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 43 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 45 | - ->getMock(); |
|
| 40 | + public function testGetHeaderException() |
|
| 41 | + { |
|
| 42 | + $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 43 | + ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 44 | + ->setMethods( array( 'setViewParams' ) ) |
|
| 45 | + ->getMock(); |
|
| 46 | 46 | |
| 47 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 47 | + $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 48 | + ->will( $this->throwException( new \Exception() ) ); |
|
| 49 | 49 | |
| 50 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 50 | + $object->setView( \TestHelperHtml::getView() ); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( null, $object->getHeader() ); |
|
| 53 | - } |
|
| 52 | + $this->assertEquals( null, $object->getHeader() ); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - public function testGetBody() |
|
| 57 | - { |
|
| 58 | - $view = $this->object->getView(); |
|
| 59 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) ); |
|
| 60 | - $view->addHelper( 'param', $helper ); |
|
| 56 | + public function testGetBody() |
|
| 57 | + { |
|
| 58 | + $view = $this->object->getView(); |
|
| 59 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, array( 'f_search' => 'Unterpro' ) ); |
|
| 60 | + $view->addHelper( 'param', $helper ); |
|
| 61 | 61 | |
| 62 | - $output = $this->object->getBody(); |
|
| 62 | + $output = $this->object->getBody(); |
|
| 63 | 63 | |
| 64 | - $this->assertNotEquals( array(), $this->object->getView()->suggestTextItems ); |
|
| 65 | - $this->assertRegExp( '#"id":.*,"name":"Unterpro.*","url":"<a#smU', $output ); |
|
| 66 | - } |
|
| 64 | + $this->assertNotEquals( array(), $this->object->getView()->suggestTextItems ); |
|
| 65 | + $this->assertRegExp( '#"id":.*,"name":"Unterpro.*","url":"<a#smU', $output ); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | |
| 69 | - public function testGetBodyException() |
|
| 70 | - { |
|
| 71 | - $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 72 | - ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 73 | - ->setMethods( array( 'setViewParams' ) ) |
|
| 74 | - ->getMock(); |
|
| 69 | + public function testGetBodyException() |
|
| 70 | + { |
|
| 71 | + $object = $this->getMockBuilder( '\Aimeos\Client\Html\Catalog\Suggest\Standard' ) |
|
| 72 | + ->setConstructorArgs( array( $this->context, array() ) ) |
|
| 73 | + ->setMethods( array( 'setViewParams' ) ) |
|
| 74 | + ->getMock(); |
|
| 75 | 75 | |
| 76 | - $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 77 | - ->will( $this->throwException( new \Exception() ) ); |
|
| 76 | + $object->expects( $this->once() )->method( 'setViewParams' ) |
|
| 77 | + ->will( $this->throwException( new \Exception() ) ); |
|
| 78 | 78 | |
| 79 | - $object->setView( \TestHelperHtml::getView() ); |
|
| 79 | + $object->setView( \TestHelperHtml::getView() ); |
|
| 80 | 80 | |
| 81 | - $this->assertEquals( null, $object->getBody() ); |
|
| 82 | - } |
|
| 81 | + $this->assertEquals( null, $object->getBody() ); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | - public function testGetSubClientInvalid() |
|
| 86 | - { |
|
| 87 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 88 | - $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 89 | - } |
|
| 85 | + public function testGetSubClientInvalid() |
|
| 86 | + { |
|
| 87 | + $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 88 | + $this->object->getSubClient( 'invalid', 'invalid' ); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | 91 | |
| 92 | - public function testGetSubClientInvalidName() |
|
| 93 | - { |
|
| 94 | - $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 95 | - $this->object->getSubClient( '$$$', '$$$' ); |
|
| 96 | - } |
|
| 92 | + public function testGetSubClientInvalidName() |
|
| 93 | + { |
|
| 94 | + $this->setExpectedException( '\\Aimeos\\Client\\Html\\Exception' ); |
|
| 95 | + $this->object->getSubClient( '$$$', '$$$' ); |
|
| 96 | + } |
|
| 97 | 97 | } |
| 98 | 98 | \ No newline at end of file |
@@ -16,8 +16,8 @@ |
||
| 16 | 16 | |
| 17 | 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 | ?> |