@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | public static function bootstrap() |
| 16 | 16 | { |
| 17 | 17 | self::getAimeos(); |
| 18 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 18 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | |
| 22 | - public static function getContext( $site = 'unittest' ) |
|
| 22 | + public static function getContext($site = 'unittest') |
|
| 23 | 23 | { |
| 24 | - if( !isset( self::$context[$site] ) ) { |
|
| 25 | - self::$context[$site] = self::createContext( $site ); |
|
| 24 | + if (!isset(self::$context[$site])) { |
|
| 25 | + self::$context[$site] = self::createContext($site); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | return clone self::$context[$site]; |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public static function getAimeos() |
| 33 | 33 | { |
| 34 | - if( !isset( self::$aimeos ) ) |
|
| 34 | + if (!isset(self::$aimeos)) |
|
| 35 | 35 | { |
| 36 | 36 | require_once 'Bootstrap.php'; |
| 37 | - spl_autoload_register( 'Aimeos\\Bootstrap::autoload' ); |
|
| 37 | + spl_autoload_register('Aimeos\\Bootstrap::autoload'); |
|
| 38 | 38 | |
| 39 | - $extdir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ); |
|
| 40 | - self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), true ); |
|
| 39 | + $extdir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); |
|
| 40 | + self::$aimeos = new \Aimeos\Bootstrap(array($extdir), true); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return self::$aimeos; |
@@ -47,40 +47,40 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * @param string $site |
| 49 | 49 | */ |
| 50 | - private static function createContext( $site ) |
|
| 50 | + private static function createContext($site) |
|
| 51 | 51 | { |
| 52 | 52 | $ctx = new \Aimeos\MShop\Context\Item\Standard(); |
| 53 | 53 | $aimeos = self::getAimeos(); |
| 54 | 54 | |
| 55 | 55 | |
| 56 | - $paths = $aimeos->getConfigPaths( 'mysql' ); |
|
| 56 | + $paths = $aimeos->getConfigPaths('mysql'); |
|
| 57 | 57 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 58 | 58 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 59 | 59 | |
| 60 | - $conf = new \Aimeos\MW\Config\PHPArray( array(), $paths ); |
|
| 61 | - $conf = new \Aimeos\MW\Config\Decorator\Memory( $conf ); |
|
| 62 | - $conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file ); |
|
| 63 | - $ctx->setConfig( $conf ); |
|
| 60 | + $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); |
|
| 61 | + $conf = new \Aimeos\MW\Config\Decorator\Memory($conf); |
|
| 62 | + $conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file); |
|
| 63 | + $ctx->setConfig($conf); |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $conf ); |
|
| 67 | - $ctx->setDatabaseManager( $dbm ); |
|
| 66 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($conf); |
|
| 67 | + $ctx->setDatabaseManager($dbm); |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | - $logger = new \Aimeos\MW\Logger\File( 'unittest.log', \Aimeos\MW\Logger\Base::DEBUG ); |
|
| 71 | - $ctx->setLogger( $logger ); |
|
| 70 | + $logger = new \Aimeos\MW\Logger\File('unittest.log', \Aimeos\MW\Logger\Base::DEBUG); |
|
| 71 | + $ctx->setLogger($logger); |
|
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | $session = new \Aimeos\MW\Session\None(); |
| 75 | - $ctx->setSession( $session ); |
|
| 75 | + $ctx->setSession($session); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx ); |
|
| 79 | - $locale = $localeManager->bootstrap( $site, '', '', false ); |
|
| 80 | - $ctx->setLocale( $locale ); |
|
| 78 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx); |
|
| 79 | + $locale = $localeManager->bootstrap($site, '', '', false); |
|
| 80 | + $ctx->setLocale($locale); |
|
| 81 | 81 | |
| 82 | 82 | |
| 83 | - $ctx->setEditor( 'core:controller/common' ); |
|
| 83 | + $ctx->setEditor('core:controller/common'); |
|
| 84 | 84 | |
| 85 | 85 | return $ctx; |
| 86 | 86 | } |
@@ -21,10 +21,10 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | protected function setUp() |
| 23 | 23 | { |
| 24 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 24 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 25 | 25 | |
| 26 | 26 | $this->context = \TestHelperCntl::getContext(); |
| 27 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, array() ); |
|
| 27 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, array()); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | protected function tearDown() |
| 38 | 38 | { |
| 39 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 39 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 40 | 40 | \Aimeos\MShop\Factory::clear(); |
| 41 | 41 | |
| 42 | 42 | $this->object = null; |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function testProcess() |
| 47 | 47 | { |
| 48 | - $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->createItem(); |
|
| 48 | + $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->createItem(); |
|
| 49 | 49 | |
| 50 | - $result = $this->object->process( $product, array( 'test' ) ); |
|
| 50 | + $result = $this->object->process($product, array('test')); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( array( 'test' ), $result ); |
|
| 52 | + $this->assertEquals(array('test'), $result); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -14,46 +14,46 @@ |
||
| 14 | 14 | |
| 15 | 15 | protected function setUp() |
| 16 | 16 | { |
| 17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 17 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); |
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard( $context ); |
|
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard($context); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() |
| 25 | 25 | { |
| 26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 26 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 27 | 27 | \Aimeos\MShop\Factory::clear(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() |
| 32 | 32 | { |
| 33 | - $item = $this->object->get( 'black', 'color' ); |
|
| 33 | + $item = $this->object->get('black', 'color'); |
|
| 34 | 34 | |
| 35 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
| 36 | - $this->assertEquals( 'black', $item->getCode() ); |
|
| 37 | - $this->assertEquals( 'color', $item->getType() ); |
|
| 35 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
| 36 | + $this->assertEquals('black', $item->getCode()); |
|
| 37 | + $this->assertEquals('color', $item->getType()); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | public function testGetUnknown() |
| 42 | 42 | { |
| 43 | - $this->assertEquals( null, $this->object->get( 'cache-test', 'color' ) ); |
|
| 43 | + $this->assertEquals(null, $this->object->get('cache-test', 'color')); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | public function testSet() |
| 48 | 48 | { |
| 49 | - $item = $this->object->get( 'black', 'color' ); |
|
| 50 | - $item->setCode( 'cache-test' ); |
|
| 49 | + $item = $this->object->get('black', 'color'); |
|
| 50 | + $item->setCode('cache-test'); |
|
| 51 | 51 | |
| 52 | - $this->object->set( $item ); |
|
| 53 | - $item = $this->object->get( 'cache-test', 'color' ); |
|
| 52 | + $this->object->set($item); |
|
| 53 | + $item = $this->object->get('cache-test', 'color'); |
|
| 54 | 54 | |
| 55 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
| 56 | - $this->assertEquals( 'cache-test', $item->getCode() ); |
|
| 57 | - $this->assertEquals( 'color', $item->getType() ); |
|
| 55 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
| 56 | + $this->assertEquals('cache-test', $item->getCode()); |
|
| 57 | + $this->assertEquals('color', $item->getType()); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -14,44 +14,44 @@ |
||
| 14 | 14 | |
| 15 | 15 | protected function setUp() |
| 16 | 16 | { |
| 17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 17 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); |
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context ); |
|
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() |
| 25 | 25 | { |
| 26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 26 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 27 | 27 | \Aimeos\MShop\Factory::clear(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() |
| 32 | 32 | { |
| 33 | - $result = $this->object->get( 'root' ); |
|
| 33 | + $result = $this->object->get('root'); |
|
| 34 | 34 | |
| 35 | - $this->assertNotEquals( null, $result ); |
|
| 36 | - $this->assertInternalType( 'integer', $result ); |
|
| 35 | + $this->assertNotEquals(null, $result); |
|
| 36 | + $this->assertInternalType('integer', $result); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetUnknown() |
| 41 | 41 | { |
| 42 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
| 42 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | public function testSet() |
| 47 | 47 | { |
| 48 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'catalog' )->createItem(); |
|
| 49 | - $item->setCode( 'cache-test' ); |
|
| 50 | - $item->setId( 1 ); |
|
| 48 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'catalog')->createItem(); |
|
| 49 | + $item->setCode('cache-test'); |
|
| 50 | + $item->setId(1); |
|
| 51 | 51 | |
| 52 | - $this->object->set( $item ); |
|
| 53 | - $id = $this->object->get( 'cache-test' ); |
|
| 52 | + $this->object->set($item); |
|
| 53 | + $id = $this->object->get('cache-test'); |
|
| 54 | 54 | |
| 55 | - $this->assertEquals( $item->getId(), $id ); |
|
| 55 | + $this->assertEquals($item->getId(), $id); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | \ No newline at end of file |
@@ -14,43 +14,43 @@ |
||
| 14 | 14 | |
| 15 | 15 | protected function setUp() |
| 16 | 16 | { |
| 17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 17 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); |
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Warehouse\Standard( $context ); |
|
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Warehouse\Standard($context); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() |
| 25 | 25 | { |
| 26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 26 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 27 | 27 | \Aimeos\MShop\Factory::clear(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() |
| 32 | 32 | { |
| 33 | - $result = $this->object->get( 'default' ); |
|
| 33 | + $result = $this->object->get('default'); |
|
| 34 | 34 | |
| 35 | - $this->assertNotEquals( null, $result ); |
|
| 35 | + $this->assertNotEquals(null, $result); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testGetUnknown() |
| 40 | 40 | { |
| 41 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
| 41 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | public function testSet() |
| 46 | 46 | { |
| 47 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'product/stock/warehouse' )->createItem(); |
|
| 48 | - $item->setCode( 'cache-test' ); |
|
| 49 | - $item->setId( 1 ); |
|
| 47 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product/stock/warehouse')->createItem(); |
|
| 48 | + $item->setCode('cache-test'); |
|
| 49 | + $item->setId(1); |
|
| 50 | 50 | |
| 51 | - $this->object->set( $item ); |
|
| 52 | - $id = $this->object->get( 'cache-test' ); |
|
| 51 | + $this->object->set($item); |
|
| 52 | + $id = $this->object->get('cache-test'); |
|
| 53 | 53 | |
| 54 | - $this->assertEquals( $item->getId(), $id ); |
|
| 54 | + $this->assertEquals($item->getId(), $id); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file |
@@ -14,41 +14,41 @@ |
||
| 14 | 14 | |
| 15 | 15 | protected function setUp() |
| 16 | 16 | { |
| 17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 17 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); |
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context ); |
|
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() |
| 25 | 25 | { |
| 26 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 26 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 27 | 27 | \Aimeos\MShop\Factory::clear(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() |
| 32 | 32 | { |
| 33 | - $this->assertNotEquals( null, $this->object->get( 'CNC' ) ); |
|
| 33 | + $this->assertNotEquals(null, $this->object->get('CNC')); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | public function testGetUnknown() |
| 38 | 38 | { |
| 39 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
| 39 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | public function testSet() |
| 44 | 44 | { |
| 45 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'product' )->createItem(); |
|
| 46 | - $item->setCode( 'cache-test' ); |
|
| 47 | - $item->setId( 1 ); |
|
| 45 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product')->createItem(); |
|
| 46 | + $item->setCode('cache-test'); |
|
| 47 | + $item->setId(1); |
|
| 48 | 48 | |
| 49 | - $this->object->set( $item ); |
|
| 50 | - $id = $this->object->get( 'cache-test' ); |
|
| 49 | + $this->object->set($item); |
|
| 50 | + $id = $this->object->get('cache-test'); |
|
| 51 | 51 | |
| 52 | - $this->assertEquals( $item->getId(), $id ); |
|
| 52 | + $this->assertEquals($item->getId(), $id); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -14,92 +14,92 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | protected function setUp() |
| 16 | 16 | { |
| 17 | - \Aimeos\MShop\Factory::setCache( true ); |
|
| 17 | + \Aimeos\MShop\Factory::setCache(true); |
|
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); |
| 20 | 20 | $aimeos = \TestHelperCntl::getAimeos(); |
| 21 | 21 | |
| 22 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
| 22 | + $this->object = new TestAbstract($context, $aimeos); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - \Aimeos\MShop\Factory::setCache( false ); |
|
| 28 | + \Aimeos\MShop\Factory::setCache(false); |
|
| 29 | 29 | \Aimeos\MShop\Factory::clear(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGetCache() |
| 34 | 34 | { |
| 35 | - $cache = $this->object->getCachePublic( 'attribute' ); |
|
| 35 | + $cache = $this->object->getCachePublic('attribute'); |
|
| 36 | 36 | |
| 37 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache ); |
|
| 37 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | public function testGetCacheInvalidType() |
| 42 | 42 | { |
| 43 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 44 | - $this->object->getCachePublic( '$' ); |
|
| 43 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 44 | + $this->object->getCachePublic('$'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | public function testGetCacheInvalidClass() |
| 49 | 49 | { |
| 50 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 51 | - $this->object->getCachePublic( 'unknown' ); |
|
| 50 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 51 | + $this->object->getCachePublic('unknown'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | public function testGetCacheInvalidInterface() |
| 56 | 56 | { |
| 57 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 58 | - $this->object->getCachePublic( 'attribute', 'unknown' ); |
|
| 57 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 58 | + $this->object->getCachePublic('attribute', 'unknown'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | public function testGetProcessors() |
| 63 | 63 | { |
| 64 | - $processor = $this->object->getProcessorsPublic( array( 'attribute' => array() ) ); |
|
| 64 | + $processor = $this->object->getProcessorsPublic(array('attribute' => array())); |
|
| 65 | 65 | |
| 66 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor ); |
|
| 66 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | public function testGetProcessorsInvalidType() |
| 71 | 71 | { |
| 72 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 73 | - $this->object->getProcessorsPublic( array( '$' => array() ) ); |
|
| 72 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 73 | + $this->object->getProcessorsPublic(array('$' => array())); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | public function testGetProcessorsInvalidClass() |
| 78 | 78 | { |
| 79 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 80 | - $this->object->getProcessorsPublic( array( 'unknown' => array() ) ); |
|
| 79 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 80 | + $this->object->getProcessorsPublic(array('unknown' => array())); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | public function testGetProcessorsInvalidInterface() |
| 85 | 85 | { |
| 86 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 87 | - $this->object->getProcessorsPublic( array( 'unknown' => array() ) ); |
|
| 86 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 87 | + $this->object->getProcessorsPublic(array('unknown' => array())); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | public function testGetTypeId() |
| 92 | 92 | { |
| 93 | - $typeid = $this->object->getTypeIdPublic( 'attribute/type', 'product', 'color' ); |
|
| 93 | + $typeid = $this->object->getTypeIdPublic('attribute/type', 'product', 'color'); |
|
| 94 | 94 | |
| 95 | - $this->assertNotEquals( null, $typeid ); |
|
| 95 | + $this->assertNotEquals(null, $typeid); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testGetTypeIdUnknown() |
| 100 | 100 | { |
| 101 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 102 | - $this->object->getTypeIdPublic( 'attribute/type', 'product', 'unknown' ); |
|
| 101 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 102 | + $this->object->getTypeIdPublic('attribute/type', 'product', 'unknown'); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | class TestAbstract |
| 108 | 108 | extends \Aimeos\Controller\Common\Product\Import\Csv\Base |
| 109 | 109 | { |
| 110 | - public function getCachePublic( $type, $name = null ) |
|
| 110 | + public function getCachePublic($type, $name = null) |
|
| 111 | 111 | { |
| 112 | - return $this->getCache( $type, $name ); |
|
| 112 | + return $this->getCache($type, $name); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | - public function getProcessorsPublic( array $mappings ) |
|
| 116 | + public function getProcessorsPublic(array $mappings) |
|
| 117 | 117 | { |
| 118 | - return $this->getProcessors( $mappings ); |
|
| 118 | + return $this->getProcessors($mappings); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | - public function getTypeIdPublic( $path, $domain, $code ) |
|
| 122 | + public function getTypeIdPublic($path, $domain, $code) |
|
| 123 | 123 | { |
| 124 | - return $this->getTypeId( $path, $domain, $code ); |
|
| 124 | + return $this->getTypeId($path, $domain, $code); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string|null $name Name of the controller or "Standard" if null |
| 31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object |
| 32 | 32 | */ |
| 33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) |
|
| 33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) |
|
| 34 | 34 | { |
| 35 | 35 | /** controller/jobs/order/email/payment/name |
| 36 | 36 | * Class name of the used order email payment scheduler controller implementation |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | * @since 2014.03 |
| 66 | 66 | * @category Developer |
| 67 | 67 | */ |
| 68 | - if( $name === null ) { |
|
| 69 | - $name = $context->getConfig()->get( 'controller/jobs/order/email/payment/name', 'Standard' ); |
|
| 68 | + if ($name === null) { |
|
| 69 | + $name = $context->getConfig()->get('controller/jobs/order/email/payment/name', 'Standard'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if( ctype_alnum( $name ) === false ) |
|
| 72 | + if (ctype_alnum($name) === false) |
|
| 73 | 73 | { |
| 74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Email\\Payment\\' . $name : '<not a string>'; |
|
| 75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Email\\Payment\\' . $name : '<not a string>'; |
|
| 75 | + throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; |
| 79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Email\\Payment\\' . $name; |
| 80 | 80 | |
| 81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); |
|
| 81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); |
|
| 82 | 82 | |
| 83 | 83 | /** controller/jobs/order/email/payment/decorators/excludes |
| 84 | 84 | * Excludes decorators added by the "common" option from the order email payment controllers |
@@ -154,6 +154,6 @@ discard block |
||
| 154 | 154 | * @see controller/jobs/order/email/payment/decorators/excludes |
| 155 | 155 | * @see controller/jobs/order/email/payment/decorators/global |
| 156 | 156 | */ |
| 157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/email/payment' ); |
|
| 157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/email/payment'); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getName() |
| 31 | 31 | { |
| 32 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Order payment related e-mails' ); |
|
| 32 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Order payment related e-mails'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function getDescription() |
| 42 | 42 | { |
| 43 | - return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Sends order confirmation or payment status update e-mails' ); |
|
| 43 | + return $this->getContext()->getI18n()->dt('controller/jobs', 'Sends order confirmation or payment status update e-mails'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
@@ -57,16 +57,16 @@ discard block |
||
| 57 | 57 | $mailer = $context->getMail(); |
| 58 | 58 | $view = $context->getView(); |
| 59 | 59 | |
| 60 | - $templatePaths = $aimeos->getCustomPaths( 'client/html/templates' ); |
|
| 60 | + $templatePaths = $aimeos->getCustomPaths('client/html/templates'); |
|
| 61 | 61 | |
| 62 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 63 | - $view->addHelper( 'config', $helper ); |
|
| 62 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 63 | + $view->addHelper('config', $helper); |
|
| 64 | 64 | |
| 65 | - $client = \Aimeos\Client\Html\Email\Payment\Factory::createClient( $context, $templatePaths ); |
|
| 65 | + $client = \Aimeos\Client\Html\Email\Payment\Factory::createClient($context, $templatePaths); |
|
| 66 | 66 | |
| 67 | - $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( $context ); |
|
| 68 | - $orderStatusManager = $orderManager->getSubManager( 'status' ); |
|
| 69 | - $orderBaseManager = $orderManager->getSubManager( 'base' ); |
|
| 67 | + $orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($context); |
|
| 68 | + $orderStatusManager = $orderManager->getSubManager('status'); |
|
| 69 | + $orderBaseManager = $orderManager->getSubManager('base'); |
|
| 70 | 70 | |
| 71 | 71 | /** controller/jobs/order/email/payment/standard/limit-days |
| 72 | 72 | * Only send payment e-mails of orders that were created in the past within the configured number of days |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | * @see controller/jobs/order/email/delivery/standard/limit-days |
| 84 | 84 | * @see controller/jobs/service/delivery/process/limit-days |
| 85 | 85 | */ |
| 86 | - $limit = $config->get( 'controller/jobs/order/email/payment/standard/limit-days', 30 ); |
|
| 87 | - $limitDate = date( 'Y-m-d H:i:s', time() - $limit * 86400 ); |
|
| 86 | + $limit = $config->get('controller/jobs/order/email/payment/standard/limit-days', 30); |
|
| 87 | + $limitDate = date('Y-m-d H:i:s', time() - $limit * 86400); |
|
| 88 | 88 | |
| 89 | 89 | $default = array( |
| 90 | 90 | \Aimeos\MShop\Order\Item\Base::PAY_REFUND, |
@@ -116,71 +116,71 @@ discard block |
||
| 116 | 116 | * @see controller/jobs/order/email/delivery/standard/status |
| 117 | 117 | * @see controller/jobs/order/email/payment/standard/limit-days |
| 118 | 118 | */ |
| 119 | - foreach( (array) $config->get( 'controller/jobs/order/email/payment/standard/status', $default ) as $status ) |
|
| 119 | + foreach ((array) $config->get('controller/jobs/order/email/payment/standard/status', $default) as $status) |
|
| 120 | 120 | { |
| 121 | 121 | $orderSearch = $orderManager->createSearch(); |
| 122 | 122 | |
| 123 | - $param = array( \Aimeos\MShop\Order\Item\Status\Base::EMAIL_PAYMENT, $status ); |
|
| 124 | - $orderFunc = $orderSearch->createFunction( 'order.containsStatus', $param ); |
|
| 123 | + $param = array(\Aimeos\MShop\Order\Item\Status\Base::EMAIL_PAYMENT, $status); |
|
| 124 | + $orderFunc = $orderSearch->createFunction('order.containsStatus', $param); |
|
| 125 | 125 | |
| 126 | 126 | $expr = array( |
| 127 | - $orderSearch->compare( '>=', 'order.mtime', $limitDate ), |
|
| 128 | - $orderSearch->compare( '==', 'order.statuspayment', $status ), |
|
| 129 | - $orderSearch->compare( '==', $orderFunc, 0 ), |
|
| 127 | + $orderSearch->compare('>=', 'order.mtime', $limitDate), |
|
| 128 | + $orderSearch->compare('==', 'order.statuspayment', $status), |
|
| 129 | + $orderSearch->compare('==', $orderFunc, 0), |
|
| 130 | 130 | ); |
| 131 | - $orderSearch->setConditions( $orderSearch->combine( '&&', $expr ) ); |
|
| 131 | + $orderSearch->setConditions($orderSearch->combine('&&', $expr)); |
|
| 132 | 132 | |
| 133 | 133 | $start = 0; |
| 134 | 134 | |
| 135 | 135 | do |
| 136 | 136 | { |
| 137 | - $items = $orderManager->searchItems( $orderSearch ); |
|
| 137 | + $items = $orderManager->searchItems($orderSearch); |
|
| 138 | 138 | |
| 139 | - foreach( $items as $id => $item ) |
|
| 139 | + foreach ($items as $id => $item) |
|
| 140 | 140 | { |
| 141 | 141 | try |
| 142 | 142 | { |
| 143 | - $orderBaseItem = $orderBaseManager->load( $item->getBaseId() ); |
|
| 143 | + $orderBaseItem = $orderBaseManager->load($item->getBaseId()); |
|
| 144 | 144 | |
| 145 | - $addr = $orderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
| 145 | + $addr = $orderBaseItem->getAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT); |
|
| 146 | 146 | |
| 147 | 147 | $view->extAddressItem = $addr; |
| 148 | 148 | $view->extOrderBaseItem = $orderBaseItem; |
| 149 | 149 | $view->extOrderItem = $item; |
| 150 | 150 | |
| 151 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $context->getI18n( $addr->getLanguageId() ) ); |
|
| 152 | - $view->addHelper( 'translate', $helper ); |
|
| 151 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $context->getI18n($addr->getLanguageId())); |
|
| 152 | + $view->addHelper('translate', $helper); |
|
| 153 | 153 | |
| 154 | 154 | $message = $mailer->createMessage(); |
| 155 | - $helper = new \Aimeos\MW\View\Helper\Mail\Standard( $view, $message ); |
|
| 156 | - $view->addHelper( 'mail', $helper ); |
|
| 155 | + $helper = new \Aimeos\MW\View\Helper\Mail\Standard($view, $message); |
|
| 156 | + $view->addHelper('mail', $helper); |
|
| 157 | 157 | |
| 158 | - $client->setView( $view ); |
|
| 158 | + $client->setView($view); |
|
| 159 | 159 | $client->getHeader(); |
| 160 | 160 | $client->getBody(); |
| 161 | 161 | |
| 162 | - $mailer->send( $message ); |
|
| 162 | + $mailer->send($message); |
|
| 163 | 163 | |
| 164 | 164 | $statusItem = $orderStatusManager->createItem(); |
| 165 | - $statusItem->setParentId( $id ); |
|
| 166 | - $statusItem->setType( \Aimeos\MShop\Order\Item\Status\Base::EMAIL_PAYMENT ); |
|
| 167 | - $statusItem->setValue( $status ); |
|
| 165 | + $statusItem->setParentId($id); |
|
| 166 | + $statusItem->setType(\Aimeos\MShop\Order\Item\Status\Base::EMAIL_PAYMENT); |
|
| 167 | + $statusItem->setValue($status); |
|
| 168 | 168 | |
| 169 | - $orderStatusManager->saveItem( $statusItem ); |
|
| 169 | + $orderStatusManager->saveItem($statusItem); |
|
| 170 | 170 | } |
| 171 | - catch( \Exception $e ) |
|
| 171 | + catch (\Exception $e) |
|
| 172 | 172 | { |
| 173 | 173 | $str = 'Error while trying to send payment e-mail for order ID "%1$s" and status "%2$s": %3$s'; |
| 174 | - $msg = sprintf( $str, $item->getId(), $item->getPaymentStatus(), $e->getMessage() ); |
|
| 175 | - $context->getLogger()->log( $msg ); |
|
| 174 | + $msg = sprintf($str, $item->getId(), $item->getPaymentStatus(), $e->getMessage()); |
|
| 175 | + $context->getLogger()->log($msg); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $count = count( $items ); |
|
| 179 | + $count = count($items); |
|
| 180 | 180 | $start += $count; |
| 181 | - $orderSearch->setSlice( $start ); |
|
| 181 | + $orderSearch->setSlice($start); |
|
| 182 | 182 | } |
| 183 | - while( $count >= $orderSearch->getSliceSize() ); |
|
| 183 | + while ($count >= $orderSearch->getSliceSize()); |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | } |
@@ -173,8 +173,7 @@ |
||
| 173 | 173 | $statusItem->setValue( $status ); |
| 174 | 174 | |
| 175 | 175 | $orderStatusManager->saveItem( $statusItem ); |
| 176 | - } |
|
| 177 | - catch( \Exception $e ) |
|
| 176 | + } catch( \Exception $e ) |
|
| 178 | 177 | { |
| 179 | 178 | $str = 'Error while trying to send delivery e-mail for order ID "%1$s" and status "%2$s": %3$s'; |
| 180 | 179 | $msg = sprintf( $str, $item->getId(), $item->getDeliveryStatus(), $e->getMessage() ); |