@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Order\Base\Standard( $this->context, $this->view, $templatePaths, 'order/base' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Order\Base\Standard($this->context, $this->view, $templatePaths, 'order/base'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,27 +30,27 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'order.base.price' => '4800.00' ) |
|
| 33 | + '==' => array('order.base.price' => '4800.00') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'order/base/address,order/base/product' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 44 | - |
|
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'order/base', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['order/base/address'] ) ); |
|
| 51 | - $this->assertEquals( 6, count( $result['data'][0]['relationships']['order/base/product'] ) ); |
|
| 52 | - $this->assertEquals( 7, count( $result['included'] ) ); |
|
| 53 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | + |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(1, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(1, count($result['data'])); |
|
| 49 | + $this->assertEquals('order/base', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(1, count($result['data'][0]['relationships']['order/base/address'])); |
|
| 51 | + $this->assertEquals(6, count($result['data'][0]['relationships']['order/base/product'])); |
|
| 52 | + $this->assertEquals(7, count($result['included'])); |
|
| 53 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
@@ -63,22 +63,22 @@ discard block |
||
| 63 | 63 | 'sort' => 'order.base.id', |
| 64 | 64 | 'include' => 'order/base/product' |
| 65 | 65 | ); |
| 66 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 67 | - $this->view->addHelper( 'param', $helper ); |
|
| 66 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 67 | + $this->view->addHelper('param', $helper); |
|
| 68 | 68 | |
| 69 | 69 | $header = array(); |
| 70 | 70 | $status = 500; |
| 71 | 71 | |
| 72 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 73 | - |
|
| 74 | - $this->assertEquals( 200, $status ); |
|
| 75 | - $this->assertEquals( 1, count( $header ) ); |
|
| 76 | - $this->assertGreaterThanOrEqual( 4, $result['meta']['total'] ); |
|
| 77 | - $this->assertGreaterThanOrEqual( 4, count( $result['data'] ) ); |
|
| 78 | - $this->assertEquals( 'order/base', $result['data'][0]['type'] ); |
|
| 79 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
| 80 | - $this->assertGreaterThanOrEqual( 4, count( $result['data'][0]['relationships']['order/base/product'] ) ); |
|
| 81 | - $this->assertGreaterThanOrEqual( 14, count( $result['included'] ) ); |
|
| 82 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 72 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 73 | + |
|
| 74 | + $this->assertEquals(200, $status); |
|
| 75 | + $this->assertEquals(1, count($header)); |
|
| 76 | + $this->assertGreaterThanOrEqual(4, $result['meta']['total']); |
|
| 77 | + $this->assertGreaterThanOrEqual(4, count($result['data'])); |
|
| 78 | + $this->assertEquals('order/base', $result['data'][0]['type']); |
|
| 79 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
| 80 | + $this->assertGreaterThanOrEqual(4, count($result['data'][0]['relationships']['order/base/product'])); |
|
| 81 | + $this->assertGreaterThanOrEqual(14, count($result['included'])); |
|
| 82 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Text\Standard( $this->context, $this->view, $templatePaths, 'text' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Text\Standard($this->context, $this->view, $templatePaths, 'text'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'text.label' => 'misc_long_desc' ) |
|
| 33 | + '==' => array('text.label' => 'misc_long_desc') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'media' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | 44 | |
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'text', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 4, count( $result['data'][0]['relationships']['media'] ) ); |
|
| 51 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
| 52 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(1, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(1, count($result['data'])); |
|
| 49 | + $this->assertEquals('text', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(4, count($result['data'][0]['relationships']['media'])); |
|
| 51 | + $this->assertEquals(4, count($result['included'])); |
|
| 52 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Media\Standard( $this->context, $this->view, $templatePaths, 'price' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Media\Standard($this->context, $this->view, $templatePaths, 'price'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'price.value' => '12.95' ) |
|
| 33 | + '==' => array('price.value' => '12.95') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'attribute' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | 44 | |
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 2, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 2, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'price', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 0, count( $result['data'][0]['relationships'] ) ); |
|
| 51 | - $this->assertEquals( 0, count( $result['included'] ) ); |
|
| 52 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(2, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(2, count($result['data'])); |
|
| 49 | + $this->assertEquals('price', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(0, count($result['data'][0]['relationships'])); |
|
| 51 | + $this->assertEquals(0, count($result['included'])); |
|
| 52 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard( $this->context, $this->view, $templatePaths, 'attribute' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard($this->context, $this->view, $templatePaths, 'attribute'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'attribute.code' => 's' ) |
|
| 33 | + '==' => array('attribute.code' => 's') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'text' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | 44 | |
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'attribute', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['text'] ) ); |
|
| 51 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
| 52 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(1, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(1, count($result['data'])); |
|
| 49 | + $this->assertEquals('attribute', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(1, count($result['data'][0]['relationships']['text'])); |
|
| 51 | + $this->assertEquals(1, count($result['included'])); |
|
| 52 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Service\Standard( $this->context, $this->view, $templatePaths, 'service' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Service\Standard($this->context, $this->view, $templatePaths, 'service'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'service.code' => 'unitpaymentcode' ) |
|
| 33 | + '==' => array('service.code' => 'unitpaymentcode') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'text' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | 44 | |
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'service', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 3, count( $result['data'][0]['relationships']['text'] ) ); |
|
| 51 | - $this->assertEquals( 3, count( $result['included'] ) ); |
|
| 52 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(1, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(1, count($result['data'])); |
|
| 49 | + $this->assertEquals('service', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(3, count($result['data'][0]['relationships']['text'])); |
|
| 51 | + $this->assertEquals(3, count($result['included'])); |
|
| 52 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
| 23 | 23 | $this->view = $this->context->getView(); |
| 24 | 24 | |
| 25 | - $this->object = new \Aimeos\Admin\JsonAdm\Media\Standard( $this->context, $this->view, $templatePaths, 'media' ); |
|
| 25 | + $this->object = new \Aimeos\Admin\JsonAdm\Media\Standard($this->context, $this->view, $templatePaths, 'media'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $params = array( |
| 32 | 32 | 'filter' => array( |
| 33 | - '==' => array( 'media.label' => 'cn_colombie_179x178' ) |
|
| 33 | + '==' => array('media.label' => 'cn_colombie_179x178') |
|
| 34 | 34 | ), |
| 35 | 35 | 'include' => 'attribute' |
| 36 | 36 | ); |
| 37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
| 38 | - $this->view->addHelper( 'param', $helper ); |
|
| 37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
| 38 | + $this->view->addHelper('param', $helper); |
|
| 39 | 39 | |
| 40 | 40 | $header = array(); |
| 41 | 41 | $status = 500; |
| 42 | 42 | |
| 43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
| 43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
| 44 | 44 | |
| 45 | - $this->assertEquals( 200, $status ); |
|
| 46 | - $this->assertEquals( 1, count( $header ) ); |
|
| 47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
| 48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
| 49 | - $this->assertEquals( 'media', $result['data'][0]['type'] ); |
|
| 50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['attribute'] ) ); |
|
| 51 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
| 52 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
| 45 | + $this->assertEquals(200, $status); |
|
| 46 | + $this->assertEquals(1, count($header)); |
|
| 47 | + $this->assertEquals(1, $result['meta']['total']); |
|
| 48 | + $this->assertEquals(1, count($result['data'])); |
|
| 49 | + $this->assertEquals('media', $result['data'][0]['type']); |
|
| 50 | + $this->assertEquals(1, count($result['data'][0]['relationships']['attribute'])); |
|
| 51 | + $this->assertEquals(1, count($result['included'])); |
|
| 52 | + $this->assertArrayNotHasKey('errors', $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -15,15 +15,15 @@ discard block |
||
| 15 | 15 | public static function bootstrap() |
| 16 | 16 | { |
| 17 | 17 | self::getAimeos(); |
| 18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 19 | - \Aimeos\Admin\JsonAdm\Factory::setCache( false ); |
|
| 18 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 19 | + \Aimeos\Admin\JsonAdm\Factory::setCache(false); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| 23 | - public static function getContext( $site = 'unittest' ) |
|
| 23 | + public static function getContext($site = 'unittest') |
|
| 24 | 24 | { |
| 25 | - if( !isset( self::$context[$site] ) ) { |
|
| 26 | - self::$context[$site] = self::createContext( $site ); |
|
| 25 | + if (!isset(self::$context[$site])) { |
|
| 26 | + self::$context[$site] = self::createContext($site); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return clone self::$context[$site]; |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public static function getAimeos() |
| 34 | 34 | { |
| 35 | - if( !isset( self::$aimeos ) ) |
|
| 35 | + if (!isset(self::$aimeos)) |
|
| 36 | 36 | { |
| 37 | 37 | require_once 'Bootstrap.php'; |
| 38 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 38 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 39 | 39 | |
| 40 | - $extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ); |
|
| 41 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false ); |
|
| 40 | + $extdir = dirname(dirname(dirname(dirname(__FILE__)))); |
|
| 41 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return self::$aimeos; |
@@ -47,79 +47,79 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public static function getJsonadmPaths() |
| 49 | 49 | { |
| 50 | - return self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 50 | + return self::getAimeos()->getCustomPaths('admin/jsonadm/templates'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - private static function createContext( $site ) |
|
| 54 | + private static function createContext($site) |
|
| 55 | 55 | { |
| 56 | 56 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 57 | 57 | $aimeos = self::getAimeos(); |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 60 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 61 | 61 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 62 | 62 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 63 | 63 | |
| 64 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 65 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 66 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 67 | - $ctx->setConfig( $conf ); |
|
| 64 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
| 65 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 66 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 67 | + $ctx->setConfig($conf); |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 71 | - $ctx->setDatabaseManager( $dbm ); |
|
| 70 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 71 | + $ctx->setDatabaseManager($dbm); |
|
| 72 | 72 | |
| 73 | 73 | |
| 74 | - $logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 75 | - $ctx->setLogger( $logger ); |
|
| 74 | + $logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 75 | + $ctx->setLogger($logger); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | $session = new \Aimeos\MW\Session\None(); |
| 79 | - $ctx->setSession( $session ); |
|
| 79 | + $ctx->setSession($session); |
|
| 80 | 80 | |
| 81 | 81 | |
| 82 | - $i18n = new \Aimeos\MW\Translation\None( 'de' ); |
|
| 83 | - $ctx->setI18n( array( 'de' => $i18n ) ); |
|
| 82 | + $i18n = new \Aimeos\MW\Translation\None('de'); |
|
| 83 | + $ctx->setI18n(array('de' => $i18n)); |
|
| 84 | 84 | |
| 85 | 85 | |
| 86 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 87 | - $locale = $localeManager->bootstrap( $site, 'de', '', false ); |
|
| 88 | - $ctx->setLocale( $locale ); |
|
| 86 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 87 | + $locale = $localeManager->bootstrap($site, 'de', '', false); |
|
| 88 | + $ctx->setLocale($locale); |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | - $view = self::createView( $conf ); |
|
| 92 | - $ctx->setView( $view ); |
|
| 91 | + $view = self::createView($conf); |
|
| 92 | + $ctx->setView($view); |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | - $ctx->setEditor( 'core:admin/jsonadm' ); |
|
| 95 | + $ctx->setEditor('core:admin/jsonadm'); |
|
| 96 | 96 | |
| 97 | 97 | return $ctx; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | - protected static function createView( \Aimeos\MW\Config\Iface $config ) |
|
| 101 | + protected static function createView(\Aimeos\MW\Config\Iface $config) |
|
| 102 | 102 | { |
| 103 | - $tmplpaths = self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 103 | + $tmplpaths = self::getAimeos()->getCustomPaths('admin/jsonadm/templates'); |
|
| 104 | 104 | |
| 105 | - $view = new \Aimeos\MW\View\Standard( $tmplpaths ); |
|
| 105 | + $view = new \Aimeos\MW\View\Standard($tmplpaths); |
|
| 106 | 106 | |
| 107 | - $trans = new \Aimeos\MW\Translation\None( 'de_DE' ); |
|
| 108 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans ); |
|
| 109 | - $view->addHelper( 'translate', $helper ); |
|
| 107 | + $trans = new \Aimeos\MW\Translation\None('de_DE'); |
|
| 108 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans); |
|
| 109 | + $view->addHelper('translate', $helper); |
|
| 110 | 110 | |
| 111 | - $helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' ); |
|
| 112 | - $view->addHelper( 'url', $helper ); |
|
| 111 | + $helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl'); |
|
| 112 | + $view->addHelper('url', $helper); |
|
| 113 | 113 | |
| 114 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' ); |
|
| 115 | - $view->addHelper( 'number', $helper ); |
|
| 114 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', ''); |
|
| 115 | + $view->addHelper('number', $helper); |
|
| 116 | 116 | |
| 117 | - $helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' ); |
|
| 118 | - $view->addHelper( 'date', $helper ); |
|
| 117 | + $helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d'); |
|
| 118 | + $view->addHelper('date', $helper); |
|
| 119 | 119 | |
| 120 | - $config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin/jsonadm' ) ); |
|
| 121 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 122 | - $view->addHelper( 'config', $helper ); |
|
| 120 | + $config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin/jsonadm')); |
|
| 121 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 122 | + $view->addHelper('config', $helper); |
|
| 123 | 123 | |
| 124 | 124 | return $view; |
| 125 | 125 | } |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | error_reporting( -1 ); |
| 10 | -ini_set( 'display_errors', '1' ); |
|
| 10 | +ini_set('display_errors', '1'); |
|
| 11 | 11 | |
| 12 | -date_default_timezone_set( 'UTC' ); |
|
| 12 | +date_default_timezone_set('UTC'); |
|
| 13 | 13 | |
| 14 | 14 | // Set locale settings to reasonable defaults |
| 15 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
| 16 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
| 17 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
| 18 | -setlocale( LC_TIME, 'POSIX' ); |
|
| 15 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 16 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
| 17 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
| 18 | +setlocale(LC_TIME, 'POSIX'); |
|
| 19 | 19 | |
| 20 | 20 | require_once 'TestHelperJadm.php'; |
| 21 | 21 | \TestHelperJadm::bootstrap(); |
@@ -107,20 +107,20 @@ discard block |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
| 109 | 109 | */ |
| 110 | - protected function getChildItems( array $items, array $include ) |
|
| 110 | + protected function getChildItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | 112 | $list = array(); |
| 113 | - $prodIds = array_keys( $items ); |
|
| 114 | - $include = array_intersect( $include, array( 'product/property', 'product/stock' ) ); |
|
| 113 | + $prodIds = array_keys($items); |
|
| 114 | + $include = array_intersect($include, array('product/property', 'product/stock')); |
|
| 115 | 115 | |
| 116 | - foreach( $include as $type ) |
|
| 116 | + foreach ($include as $type) |
|
| 117 | 117 | { |
| 118 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type ); |
|
| 118 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type); |
|
| 119 | 119 | |
| 120 | 120 | $search = $manager->createSearch(); |
| 121 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $prodIds ) ); |
|
| 121 | + $search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $prodIds)); |
|
| 122 | 122 | |
| 123 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
| 123 | + $list = array_merge($list, $manager->searchItems($search)); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $list; |
@@ -134,17 +134,17 @@ discard block |
||
| 134 | 134 | * @param array $include List of resource types that should be fetched |
| 135 | 135 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 136 | 136 | */ |
| 137 | - protected function getListItems( array $items, array $include ) |
|
| 137 | + protected function getListItems(array $items, array $include) |
|
| 138 | 138 | { |
| 139 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' ); |
|
| 139 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists'); |
|
| 140 | 140 | |
| 141 | 141 | $search = $manager->createSearch(); |
| 142 | 142 | $expr = array( |
| 143 | - $search->compare( '==', 'product.lists.parentid', array_keys( $items ) ), |
|
| 144 | - $search->compare( '==', 'product.lists.domain', $include ), |
|
| 143 | + $search->compare('==', 'product.lists.parentid', array_keys($items)), |
|
| 144 | + $search->compare('==', 'product.lists.domain', $include), |
|
| 145 | 145 | ); |
| 146 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 146 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 147 | 147 | |
| 148 | - return $manager->searchItems( $search ); |
|
| 148 | + return $manager->searchItems($search); |
|
| 149 | 149 | } |
| 150 | 150 | } |