@@ -11,17 +11,17 @@ |
||
| 11 | 11 | * Set error reporting to maximum |
| 12 | 12 | */ |
| 13 | 13 | error_reporting( -1 ); |
| 14 | -ini_set( 'display_errors', '1' ); |
|
| 14 | +ini_set('display_errors', '1'); |
|
| 15 | 15 | |
| 16 | -date_default_timezone_set( 'UTC' ); |
|
| 16 | +date_default_timezone_set('UTC'); |
|
| 17 | 17 | |
| 18 | 18 | /* |
| 19 | 19 | * Set locale settings to reasonable defaults |
| 20 | 20 | */ |
| 21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
| 22 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
| 23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
| 24 | -setlocale( LC_TIME, 'POSIX' ); |
|
| 21 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 22 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
| 23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
| 24 | +setlocale(LC_TIME, 'POSIX'); |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | require_once 'TestHelperJqadm.php'; |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $result = $this->getClient()->delete(); |
| 30 | 30 | |
| 31 | - $ids = (array) $this->getView()->param( 'id' ); |
|
| 32 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->deleteItems( $ids ); |
|
| 31 | + $ids = (array) $this->getView()->param('id'); |
|
| 32 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->deleteItems($ids); |
|
| 33 | 33 | |
| 34 | 34 | return $result; |
| 35 | 35 | } |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $result = $this->getClient()->save(); |
| 46 | 46 | $item = $this->getView()->item; |
| 47 | 47 | |
| 48 | - if( $item->getId() !== null ) { |
|
| 49 | - \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $item ); |
|
| 48 | + if ($item->getId() !== null) { |
|
| 49 | + \Aimeos\MShop\Factory::createManager($this->getContext(), 'index')->saveItem($item); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $result; |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $result = $this->getClient()->delete(); |
| 30 | 30 | |
| 31 | - $ids = (array) $this->getView()->param( 'id' ); |
|
| 32 | - $tags = array( 'product' ); |
|
| 31 | + $ids = (array) $this->getView()->param('id'); |
|
| 32 | + $tags = array('product'); |
|
| 33 | 33 | |
| 34 | - foreach( $ids as $id ) { |
|
| 34 | + foreach ($ids as $id) { |
|
| 35 | 35 | $tags[] = 'product-' . $id; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $this->getContext()->getCache()->deleteByTags( $tags ); |
|
| 38 | + $this->getContext()->getCache()->deleteByTags($tags); |
|
| 39 | 39 | |
| 40 | 40 | return $result; |
| 41 | 41 | } |
@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | $result = $this->getClient()->save(); |
| 52 | 52 | $item = $this->getView()->item; |
| 53 | 53 | |
| 54 | - if( $item->getId() !== null ) |
|
| 54 | + if ($item->getId() !== null) |
|
| 55 | 55 | { |
| 56 | 56 | $idtag = 'product-' . $item->getId(); |
| 57 | - $this->getContext()->getCache()->deleteByTags( array( 'product', $idtag ) ); |
|
| 57 | + $this->getContext()->getCache()->deleteByTags(array('product', $idtag)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $result; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @param string|null $name Name of the sub-client (Default if null) |
| 27 | 27 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
| 28 | 28 | */ |
| 29 | - public function getSubClient( $type, $name = null ); |
|
| 29 | + public function getSubClient($type, $name = null); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Returns the view object that will generate the admin output. |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
| 42 | 42 | * @return \Aimeos\Admin\JQAdm\Iface Reference to this object for fluent calls |
| 43 | 43 | */ |
| 44 | - public function setView( \Aimeos\MW\View\Iface $view ); |
|
| 44 | + public function setView(\Aimeos\MW\View\Iface $view); |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Copies a resource |
@@ -27,13 +27,13 @@ |
||
| 27 | 27 | public function save() |
| 28 | 28 | { |
| 29 | 29 | $result = $this->getClient()->save(); |
| 30 | - $ids = array( 'catalog' ); |
|
| 30 | + $ids = array('catalog'); |
|
| 31 | 31 | |
| 32 | - foreach( $this->getView()->param( 'category/catalog.id', [] ) as $id ) { |
|
| 32 | + foreach ($this->getView()->param('category/catalog.id', []) as $id) { |
|
| 33 | 33 | $ids[] = 'catalog-' . $id; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $this->getContext()->getCache()->deleteByTags( $ids ); |
|
| 36 | + $this->getContext()->getCache()->deleteByTags($ids); |
|
| 37 | 37 | |
| 38 | 38 | return $result; |
| 39 | 39 | } |
@@ -10,17 +10,17 @@ |
||
| 10 | 10 | * Set error reporting to maximum |
| 11 | 11 | */ |
| 12 | 12 | error_reporting( -1 ); |
| 13 | -ini_set( 'display_errors', '1' ); |
|
| 13 | +ini_set('display_errors', '1'); |
|
| 14 | 14 | |
| 15 | -date_default_timezone_set( 'UTC' ); |
|
| 15 | +date_default_timezone_set('UTC'); |
|
| 16 | 16 | |
| 17 | 17 | /* |
| 18 | 18 | * Set locale settings to reasonable defaults |
| 19 | 19 | */ |
| 20 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
| 21 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
| 22 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
| 23 | -setlocale( LC_TIME, 'POSIX' ); |
|
| 20 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 21 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
| 22 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
| 23 | +setlocale(LC_TIME, 'POSIX'); |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | require_once 'TestHelperCustom.php'; |
@@ -19,52 +19,52 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $this->aimeos = \TestHelperJqadm::getAimeos(); |
| 21 | 21 | $this->context = \TestHelperJqadm::getContext(); |
| 22 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 22 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | public function testCreateClient() |
| 27 | 27 | { |
| 28 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] ); |
|
| 29 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'product' ); |
|
| 30 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 28 | + $this->context->getConfig()->set('admin/jqadm/resources', ['product']); |
|
| 29 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'product'); |
|
| 30 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | public function testCreateClientName() |
| 35 | 35 | { |
| 36 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['product'] ); |
|
| 37 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'product', 'Standard' ); |
|
| 38 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 36 | + $this->context->getConfig()->set('admin/jqadm/resources', ['product']); |
|
| 37 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'product', 'Standard'); |
|
| 38 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | public function testCreateSubClient() |
| 43 | 43 | { |
| 44 | - $this->context->getConfig()->set( 'admin/jqadm/resources', ['locale/site'] ); |
|
| 45 | - $client = \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'locale/site' ); |
|
| 46 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 44 | + $this->context->getConfig()->set('admin/jqadm/resources', ['locale/site']); |
|
| 45 | + $client = \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'locale/site'); |
|
| 46 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | public function testCreateClientNameEmpty() |
| 51 | 51 | { |
| 52 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 53 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, '' ); |
|
| 52 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 53 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, ''); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testCreateClientNameInvalid() |
| 58 | 58 | { |
| 59 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 60 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, '%product' ); |
|
| 59 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 60 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, '%product'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testCreateClientNameNotFound() |
| 65 | 65 | { |
| 66 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 67 | - \Aimeos\Admin\JQAdm\Factory::createClient( $this->context, $this->aimeos, 'unknown' ); |
|
| 66 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 67 | + \Aimeos\Admin\JQAdm\Factory::createClient($this->context, $this->aimeos, 'unknown'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | } |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '%order' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, '%order'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -17,42 +17,42 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->context = \TestHelperJqadm::getContext(); |
| 20 | - $this->context->setView( \TestHelperJqadm::getView() ); |
|
| 20 | + $this->context->setView(\TestHelperJqadm::getView()); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testCreateClient() |
| 25 | 25 | { |
| 26 | - $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context ); |
|
| 27 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 26 | + $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context); |
|
| 27 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testCreateClientName() |
| 32 | 32 | { |
| 33 | - $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, 'Standard' ); |
|
| 34 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
|
| 33 | + $client = \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, 'Standard'); |
|
| 34 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testCreateClientNameEmpty() |
| 39 | 39 | { |
| 40 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 41 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, '' ); |
|
| 40 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 41 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, ''); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testCreateClientNameInvalid() |
| 46 | 46 | { |
| 47 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 48 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, '%plugin' ); |
|
| 47 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 48 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, '%plugin'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testCreateClientNameNotFound() |
| 53 | 53 | { |
| 54 | - $this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
| 55 | - \Aimeos\Admin\JQAdm\Plugin\Factory::createClient( $this->context, 'test' ); |
|
| 54 | + $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception'); |
|
| 55 | + \Aimeos\Admin\JQAdm\Plugin\Factory::createClient($this->context, 'test'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |