@@ -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'; |
@@ -13,55 +13,55 @@ discard block |
||
| 13 | 13 | public static function bootstrap() |
| 14 | 14 | { |
| 15 | 15 | self::getAimeos(); |
| 16 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 16 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| 20 | - public static function getContext( $site = 'unittest' ) |
|
| 20 | + public static function getContext($site = 'unittest') |
|
| 21 | 21 | { |
| 22 | - if( !isset( self::$context[$site] ) ) { |
|
| 23 | - self::$context[$site] = self::createContext( $site ); |
|
| 22 | + if (!isset(self::$context[$site])) { |
|
| 23 | + self::$context[$site] = self::createContext($site); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | return clone self::$context[$site]; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null ) |
|
| 30 | + public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null) |
|
| 31 | 31 | { |
| 32 | - if( $config === null ) { |
|
| 33 | - $config = self::getContext( $site )->getConfig(); |
|
| 32 | + if ($config === null) { |
|
| 33 | + $config = self::getContext($site)->getConfig(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() ); |
|
| 36 | + $view = new \Aimeos\MW\View\Standard(self::getTemplatePaths()); |
|
| 37 | 37 | |
| 38 | 38 | $param = ['site' => 'unittest']; |
| 39 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
| 40 | - $view->addHelper( 'param', $helper ); |
|
| 39 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
| 40 | + $view->addHelper('param', $helper); |
|
| 41 | 41 | |
| 42 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 43 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 44 | - $view->addHelper( 'translate', $helper ); |
|
| 42 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
| 43 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
| 44 | + $view->addHelper('translate', $helper); |
|
| 45 | 45 | |
| 46 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 47 | - $view->addHelper( 'url', $helper ); |
|
| 46 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
| 47 | + $view->addHelper('url', $helper); |
|
| 48 | 48 | |
| 49 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 50 | - $view->addHelper( 'number', $helper ); |
|
| 49 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
| 50 | + $view->addHelper('number', $helper); |
|
| 51 | 51 | |
| 52 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 53 | - $view->addHelper( 'date', $helper ); |
|
| 52 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
| 53 | + $view->addHelper('date', $helper); |
|
| 54 | 54 | |
| 55 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) ); |
|
| 56 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 57 | - $view->addHelper( 'config', $helper ); |
|
| 55 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm')); |
|
| 56 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 57 | + $view->addHelper('config', $helper); |
|
| 58 | 58 | |
| 59 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' ); |
|
| 60 | - $view->addHelper( 'csrf', $helper ); |
|
| 59 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value'); |
|
| 60 | + $view->addHelper('csrf', $helper); |
|
| 61 | 61 | |
| 62 | - $fcn = function() { return array( 'admin' ); }; |
|
| 63 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); |
|
| 64 | - $view->addHelper( 'access', $helper ); |
|
| 62 | + $fcn = function() { return array('admin'); }; |
|
| 63 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); |
|
| 64 | + $view->addHelper('access', $helper); |
|
| 65 | 65 | |
| 66 | 66 | return $view; |
| 67 | 67 | } |
@@ -69,19 +69,19 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public static function getTemplatePaths() |
| 71 | 71 | { |
| 72 | - return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 72 | + return self::getAimeos()->getCustomPaths('admin/jqadm/templates'); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | private static function getAimeos() |
| 77 | 77 | { |
| 78 | - if( !isset( self::$aimeos ) ) |
|
| 78 | + if (!isset(self::$aimeos)) |
|
| 79 | 79 | { |
| 80 | 80 | require_once 'Bootstrap.php'; |
| 81 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 81 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 82 | 82 | |
| 83 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
| 84 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
| 83 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
| 84 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return self::$aimeos; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * @param string $site |
| 93 | 93 | */ |
| 94 | - private static function createContext( $site ) |
|
| 94 | + private static function createContext($site) |
|
| 95 | 95 | { |
| 96 | 96 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 97 | 97 | $aimeos = self::getAimeos(); |
@@ -100,44 +100,44 @@ discard block |
||
| 100 | 100 | $paths = $aimeos->getConfigPaths(); |
| 101 | 101 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 102 | 102 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 103 | - $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
|
| 103 | + $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); |
|
| 104 | 104 | |
| 105 | - $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
|
| 106 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 107 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 108 | - $ctx->setConfig( $conf ); |
|
| 105 | + $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); |
|
| 106 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 107 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 108 | + $ctx->setConfig($conf); |
|
| 109 | 109 | |
| 110 | 110 | |
| 111 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 112 | - $ctx->setDatabaseManager( $dbm ); |
|
| 111 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 112 | + $ctx->setDatabaseManager($dbm); |
|
| 113 | 113 | |
| 114 | 114 | |
| 115 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 116 | - $ctx->setFilesystemManager( $fs ); |
|
| 115 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
| 116 | + $ctx->setFilesystemManager($fs); |
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 120 | - $ctx->setLogger( $logger ); |
|
| 119 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 120 | + $ctx->setLogger($logger); |
|
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | $cache = new \Aimeos\MW\Cache\None(); |
| 124 | - $ctx->setCache( $cache ); |
|
| 124 | + $ctx->setCache($cache); |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 128 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 127 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 128 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 129 | 129 | |
| 130 | 130 | |
| 131 | 131 | $session = new \Aimeos\MW\Session\None(); |
| 132 | - $ctx->setSession( $session ); |
|
| 132 | + $ctx->setSession($session); |
|
| 133 | 133 | |
| 134 | 134 | |
| 135 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 136 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
| 137 | - $ctx->setLocale( $locale ); |
|
| 135 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 136 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
| 137 | + $ctx->setLocale($locale); |
|
| 138 | 138 | |
| 139 | 139 | |
| 140 | - $ctx->setEditor( 'ai-admin-jqadm:lib/custom' ); |
|
| 140 | + $ctx->setEditor('ai-admin-jqadm:lib/custom'); |
|
| 141 | 141 | |
| 142 | 142 | return $ctx; |
| 143 | 143 | } |
@@ -13,63 +13,63 @@ discard block |
||
| 13 | 13 | public static function bootstrap() |
| 14 | 14 | { |
| 15 | 15 | self::getAimeos(); |
| 16 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 16 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| 20 | - public static function getContext( $site = 'unittest' ) |
|
| 20 | + public static function getContext($site = 'unittest') |
|
| 21 | 21 | { |
| 22 | - if( !isset( self::$context[$site] ) ) { |
|
| 23 | - self::$context[$site] = self::createContext( $site ); |
|
| 22 | + if (!isset(self::$context[$site])) { |
|
| 23 | + self::$context[$site] = self::createContext($site); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | return clone self::$context[$site]; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null ) |
|
| 30 | + public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null) |
|
| 31 | 31 | { |
| 32 | - if( $config === null ) { |
|
| 33 | - $config = self::getContext( $site )->getConfig(); |
|
| 32 | + if ($config === null) { |
|
| 33 | + $config = self::getContext($site)->getConfig(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() ); |
|
| 36 | + $view = new \Aimeos\MW\View\Standard(self::getTemplatePaths()); |
|
| 37 | 37 | |
| 38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, ['site' => 'unittest'] ); |
|
| 39 | - $view->addHelper( 'param', $helper ); |
|
| 38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, ['site' => 'unittest']); |
|
| 39 | + $view->addHelper('param', $helper); |
|
| 40 | 40 | |
| 41 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 42 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 43 | - $view->addHelper( 'translate', $helper ); |
|
| 41 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
| 42 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
| 43 | + $view->addHelper('translate', $helper); |
|
| 44 | 44 | |
| 45 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 46 | - $view->addHelper( 'url', $helper ); |
|
| 45 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
| 46 | + $view->addHelper('url', $helper); |
|
| 47 | 47 | |
| 48 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 49 | - $view->addHelper( 'number', $helper ); |
|
| 48 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
| 49 | + $view->addHelper('number', $helper); |
|
| 50 | 50 | |
| 51 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 52 | - $view->addHelper( 'date', $helper ); |
|
| 51 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
| 52 | + $view->addHelper('date', $helper); |
|
| 53 | 53 | |
| 54 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) ); |
|
| 55 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 56 | - $view->addHelper( 'config', $helper ); |
|
| 54 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm')); |
|
| 55 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 56 | + $view->addHelper('config', $helper); |
|
| 57 | 57 | |
| 58 | - $helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, new \Aimeos\MW\Session\None() ); |
|
| 59 | - $view->addHelper( 'session', $helper ); |
|
| 58 | + $helper = new \Aimeos\MW\View\Helper\Session\Standard($view, new \Aimeos\MW\Session\None()); |
|
| 59 | + $view->addHelper('session', $helper); |
|
| 60 | 60 | |
| 61 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() ); |
|
| 62 | - $view->addHelper( 'request', $helper ); |
|
| 61 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest()); |
|
| 62 | + $view->addHelper('request', $helper); |
|
| 63 | 63 | |
| 64 | - $helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() ); |
|
| 65 | - $view->addHelper( 'response', $helper ); |
|
| 64 | + $helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response()); |
|
| 65 | + $view->addHelper('response', $helper); |
|
| 66 | 66 | |
| 67 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' ); |
|
| 68 | - $view->addHelper( 'csrf', $helper ); |
|
| 67 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value'); |
|
| 68 | + $view->addHelper('csrf', $helper); |
|
| 69 | 69 | |
| 70 | - $fcn = function() { return array( 'admin' ); }; |
|
| 71 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); |
|
| 72 | - $view->addHelper( 'access', $helper ); |
|
| 70 | + $fcn = function() { return array('admin'); }; |
|
| 71 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); |
|
| 72 | + $view->addHelper('access', $helper); |
|
| 73 | 73 | |
| 74 | 74 | $view->pageSitePath = []; |
| 75 | 75 | |
@@ -79,19 +79,19 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public static function getTemplatePaths() |
| 81 | 81 | { |
| 82 | - return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 82 | + return self::getAimeos()->getCustomPaths('admin/jqadm/templates'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | public static function getAimeos() |
| 87 | 87 | { |
| 88 | - if( !isset( self::$aimeos ) ) |
|
| 88 | + if (!isset(self::$aimeos)) |
|
| 89 | 89 | { |
| 90 | 90 | require_once 'Bootstrap.php'; |
| 91 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 91 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 92 | 92 | |
| 93 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
| 94 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
| 93 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
| 94 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return self::$aimeos; |
@@ -101,57 +101,57 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @param string $site |
| 103 | 103 | */ |
| 104 | - private static function createContext( $site ) |
|
| 104 | + private static function createContext($site) |
|
| 105 | 105 | { |
| 106 | 106 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 107 | 107 | $aimeos = self::getAimeos(); |
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 110 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 111 | 111 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 112 | 112 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 113 | - $local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) ); |
|
| 113 | + $local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp'))); |
|
| 114 | 114 | |
| 115 | - $conf = new \Aimeos\MW\Config\PHPArray( $local, $paths ); |
|
| 116 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 117 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 118 | - $ctx->setConfig( $conf ); |
|
| 115 | + $conf = new \Aimeos\MW\Config\PHPArray($local, $paths); |
|
| 116 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 117 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 118 | + $ctx->setConfig($conf); |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 122 | - $ctx->setDatabaseManager( $dbm ); |
|
| 121 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 122 | + $ctx->setDatabaseManager($dbm); |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf ); |
|
| 126 | - $ctx->setFilesystemManager( $fs ); |
|
| 125 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf); |
|
| 126 | + $ctx->setFilesystemManager($fs); |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf ); |
|
| 130 | - $ctx->setMessageQueueManager( $mq ); |
|
| 129 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($conf); |
|
| 130 | + $ctx->setMessageQueueManager($mq); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 134 | - $ctx->setLogger( $logger ); |
|
| 133 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 134 | + $ctx->setLogger($logger); |
|
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | $cache = new \Aimeos\MW\Cache\None(); |
| 138 | - $ctx->setCache( $cache ); |
|
| 138 | + $ctx->setCache($cache); |
|
| 139 | 139 | |
| 140 | 140 | |
| 141 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 142 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 141 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 142 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | $session = new \Aimeos\MW\Session\None(); |
| 146 | - $ctx->setSession( $session ); |
|
| 146 | + $ctx->setSession($session); |
|
| 147 | 147 | |
| 148 | 148 | |
| 149 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 150 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
| 151 | - $ctx->setLocale( $locale ); |
|
| 149 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 150 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
| 151 | + $ctx->setLocale($locale); |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | - $ctx->setEditor( 'ai-admin-jqadm:admin/jqadm' ); |
|
| 154 | + $ctx->setEditor('ai-admin-jqadm:admin/jqadm'); |
|
| 155 | 155 | |
| 156 | 156 | return $ctx; |
| 157 | 157 | } |
@@ -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 | } |