@@ -16,41 +16,41 @@ |
||
| 16 | 16 | |
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | - \Aimeos\MShop::cache( true ); |
|
| 19 | + \Aimeos\MShop::cache(true); |
|
| 20 | 20 | |
| 21 | 21 | $context = \TestHelperCntl::getContext(); |
| 22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context ); |
|
| 22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - \Aimeos\MShop::cache( false ); |
|
| 28 | + \Aimeos\MShop::cache(false); |
|
| 29 | 29 | \Aimeos\MShop::clear(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGet() |
| 34 | 34 | { |
| 35 | - $this->assertNotEquals( null, $this->object->get( 'CNC' ) ); |
|
| 35 | + $this->assertNotEquals(null, $this->object->get('CNC')); |
|
| 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' )->createItem(); |
|
| 48 | - $item->setCode( 'cache-test' ); |
|
| 49 | - $item->setId( 1 ); |
|
| 47 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product')->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 |
@@ -16,44 +16,44 @@ |
||
| 16 | 16 | |
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | - \Aimeos\MShop::cache( true ); |
|
| 19 | + \Aimeos\MShop::cache(true); |
|
| 20 | 20 | |
| 21 | 21 | $context = \TestHelperCntl::getContext(); |
| 22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context ); |
|
| 22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - \Aimeos\MShop::cache( false ); |
|
| 28 | + \Aimeos\MShop::cache(false); |
|
| 29 | 29 | \Aimeos\MShop::clear(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGet() |
| 34 | 34 | { |
| 35 | - $result = $this->object->get( 'root' ); |
|
| 35 | + $result = $this->object->get('root'); |
|
| 36 | 36 | |
| 37 | - $this->assertNotEquals( null, $result ); |
|
| 38 | - $this->assertInternalType( 'integer', $result ); |
|
| 37 | + $this->assertNotEquals(null, $result); |
|
| 38 | + $this->assertInternalType('integer', $result); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | public function testGetUnknown() |
| 43 | 43 | { |
| 44 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
| 44 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | public function testSet() |
| 49 | 49 | { |
| 50 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'catalog' )->createItem(); |
|
| 51 | - $item->setCode( 'cache-test' ); |
|
| 52 | - $item->setId( 1 ); |
|
| 50 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'catalog')->createItem(); |
|
| 51 | + $item->setCode('cache-test'); |
|
| 52 | + $item->setId(1); |
|
| 53 | 53 | |
| 54 | - $this->object->set( $item ); |
|
| 55 | - $id = $this->object->get( 'cache-test' ); |
|
| 54 | + $this->object->set($item); |
|
| 55 | + $id = $this->object->get('cache-test'); |
|
| 56 | 56 | |
| 57 | - $this->assertEquals( $item->getId(), $id ); |
|
| 57 | + $this->assertEquals($item->getId(), $id); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |
@@ -16,49 +16,49 @@ |
||
| 16 | 16 | |
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | - \Aimeos\MShop::cache( true ); |
|
| 19 | + \Aimeos\MShop::cache(true); |
|
| 20 | 20 | |
| 21 | 21 | $context = \TestHelperCntl::getContext(); |
| 22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard( $context ); |
|
| 22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard($context); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | protected function tearDown() |
| 27 | 27 | { |
| 28 | - \Aimeos\MShop::cache( false ); |
|
| 28 | + \Aimeos\MShop::cache(false); |
|
| 29 | 29 | \Aimeos\MShop::clear(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | public function testGet() |
| 34 | 34 | { |
| 35 | - $item = $this->object->get( 'black', 'color' ); |
|
| 35 | + $item = $this->object->get('black', 'color'); |
|
| 36 | 36 | |
| 37 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
| 38 | - $this->assertEquals( 'black', $item->getCode() ); |
|
| 39 | - $this->assertEquals( 'color', $item->getType() ); |
|
| 37 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
| 38 | + $this->assertEquals('black', $item->getCode()); |
|
| 39 | + $this->assertEquals('color', $item->getType()); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | public function testGetUnknown() |
| 44 | 44 | { |
| 45 | - $this->assertEquals( null, $this->object->get( 'cache-test', 'color' ) ); |
|
| 45 | + $this->assertEquals(null, $this->object->get('cache-test', 'color')); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testSet() |
| 50 | 50 | { |
| 51 | - $item = $this->object->get( 'black', 'color' ); |
|
| 51 | + $item = $this->object->get('black', 'color'); |
|
| 52 | 52 | |
| 53 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
| 53 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
| 54 | 54 | |
| 55 | - $item->setCode( 'cache-test' ); |
|
| 55 | + $item->setCode('cache-test'); |
|
| 56 | 56 | |
| 57 | - $this->object->set( $item ); |
|
| 58 | - $item = $this->object->get( 'cache-test', 'color' ); |
|
| 57 | + $this->object->set($item); |
|
| 58 | + $item = $this->object->get('cache-test', 'color'); |
|
| 59 | 59 | |
| 60 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
| 61 | - $this->assertEquals( 'cache-test', $item->getCode() ); |
|
| 62 | - $this->assertEquals( 'color', $item->getType() ); |
|
| 60 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
| 61 | + $this->assertEquals('cache-test', $item->getCode()); |
|
| 62 | + $this->assertEquals('color', $item->getType()); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | \ No newline at end of file |
@@ -16,62 +16,62 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | - \Aimeos\MShop::cache( true ); |
|
| 19 | + \Aimeos\MShop::cache(true); |
|
| 20 | 20 | |
| 21 | 21 | $context = \TestHelperCntl::getContext(); |
| 22 | 22 | $aimeos = \TestHelperCntl::getAimeos(); |
| 23 | 23 | |
| 24 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
| 24 | + $this->object = new TestAbstract($context, $aimeos); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | protected function tearDown() |
| 29 | 29 | { |
| 30 | - \Aimeos\MShop::cache( false ); |
|
| 30 | + \Aimeos\MShop::cache(false); |
|
| 31 | 31 | \Aimeos\MShop::clear(); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | public function testGetCacheInvalidType() |
| 36 | 36 | { |
| 37 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 38 | - $this->object->getCachePublic( '$' ); |
|
| 37 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 38 | + $this->object->getCachePublic('$'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | public function testGetCacheInvalidClass() |
| 43 | 43 | { |
| 44 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 45 | - $this->object->getCachePublic( 'unknown' ); |
|
| 44 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 45 | + $this->object->getCachePublic('unknown'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | public function testGetProcessors() |
| 50 | 50 | { |
| 51 | - $processor = $this->object->getProcessorsPublic( array( 'media' => [] ) ); |
|
| 51 | + $processor = $this->object->getProcessorsPublic(array('media' => [])); |
|
| 52 | 52 | |
| 53 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor ); |
|
| 53 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testGetProcessorsInvalidType() |
| 58 | 58 | { |
| 59 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 60 | - $this->object->getProcessorsPublic( array( '$' => [] ) ); |
|
| 59 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 60 | + $this->object->getProcessorsPublic(array('$' => [])); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testGetProcessorsInvalidClass() |
| 65 | 65 | { |
| 66 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 67 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
| 66 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 67 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | public function testGetProcessorsInvalidInterface() |
| 72 | 72 | { |
| 73 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
| 74 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
| 73 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
| 74 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -79,15 +79,15 @@ discard block |
||
| 79 | 79 | class TestAbstract |
| 80 | 80 | extends \Aimeos\Controller\Common\Catalog\Import\Csv\Base |
| 81 | 81 | { |
| 82 | - public function getCachePublic( $type, $name = null ) |
|
| 82 | + public function getCachePublic($type, $name = null) |
|
| 83 | 83 | { |
| 84 | - return $this->getCache( $type, $name ); |
|
| 84 | + return $this->getCache($type, $name); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| 88 | - public function getProcessorsPublic( array $mappings ) |
|
| 88 | + public function getProcessorsPublic(array $mappings) |
|
| 89 | 89 | { |
| 90 | - return $this->getProcessors( $mappings ); |
|
| 90 | + return $this->getProcessors($mappings); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function setUp() |
| 19 | 19 | { |
| 20 | - \Aimeos\MShop::cache( true ); |
|
| 20 | + \Aimeos\MShop::cache(true); |
|
| 21 | 21 | |
| 22 | 22 | $this->context = \TestHelperCntl::getContext(); |
| 23 | - $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
| 23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done($this->context, []); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - \Aimeos\MShop::cache( false ); |
|
| 29 | + \Aimeos\MShop::cache(false); |
|
| 30 | 30 | \Aimeos\MShop::clear(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -49,31 +49,31 @@ discard block |
||
| 49 | 49 | 4 => 1, |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 52 | + $catalog = $this->create('job_csv_test'); |
|
| 53 | 53 | |
| 54 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 55 | - $object->process( $catalog, $data ); |
|
| 54 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 55 | + $object->process($catalog, $data); |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | $listItems = $catalog->getListItems(); |
| 59 | - $listItem = reset( $listItems ); |
|
| 59 | + $listItem = reset($listItems); |
|
| 60 | 60 | |
| 61 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
| 62 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 61 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
| 62 | + $this->assertEquals(1, count($listItems)); |
|
| 63 | 63 | |
| 64 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
| 65 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
| 66 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
| 67 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
| 64 | + $this->assertEquals(1, $listItem->getStatus()); |
|
| 65 | + $this->assertEquals(0, $listItem->getPosition()); |
|
| 66 | + $this->assertEquals('text', $listItem->getDomain()); |
|
| 67 | + $this->assertEquals('default', $listItem->getType()); |
|
| 68 | 68 | |
| 69 | 69 | $refItem = $listItem->getRefItem(); |
| 70 | 70 | |
| 71 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
| 72 | - $this->assertEquals( 'name', $refItem->getType() ); |
|
| 73 | - $this->assertEquals( 'test text', $refItem->getLabel() ); |
|
| 74 | - $this->assertEquals( 'Job CSV test', $refItem->getContent() ); |
|
| 75 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
| 76 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
| 71 | + $this->assertEquals(1, $refItem->getStatus()); |
|
| 72 | + $this->assertEquals('name', $refItem->getType()); |
|
| 73 | + $this->assertEquals('test text', $refItem->getLabel()); |
|
| 74 | + $this->assertEquals('Job CSV test', $refItem->getContent()); |
|
| 75 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
| 76 | + $this->assertEquals(1, $refItem->getStatus()); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -101,27 +101,27 @@ discard block |
||
| 101 | 101 | 7 => 'Long: Job CSV test 2', |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 104 | + $catalog = $this->create('job_csv_test'); |
|
| 105 | 105 | |
| 106 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 107 | - $object->process( $catalog, $data ); |
|
| 106 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 107 | + $object->process($catalog, $data); |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | $pos = 0; |
| 111 | 111 | $listItems = $catalog->getListItems(); |
| 112 | 112 | $expected = array( |
| 113 | - 0 => array( 'name', 'Job CSV test' ), |
|
| 114 | - 1 => array( 'short', 'Short: Job CSV test' ), |
|
| 115 | - 2 => array( 'long', 'Long: Job CSV test' ), |
|
| 116 | - 3 => array( 'long', 'Long: Job CSV test 2' ), |
|
| 113 | + 0 => array('name', 'Job CSV test'), |
|
| 114 | + 1 => array('short', 'Short: Job CSV test'), |
|
| 115 | + 2 => array('long', 'Long: Job CSV test'), |
|
| 116 | + 3 => array('long', 'Long: Job CSV test 2'), |
|
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - $this->assertEquals( 4, count( $listItems ) ); |
|
| 119 | + $this->assertEquals(4, count($listItems)); |
|
| 120 | 120 | |
| 121 | - foreach( $listItems as $listItem ) |
|
| 121 | + foreach ($listItems as $listItem) |
|
| 122 | 122 | { |
| 123 | - $this->assertEquals( $expected[$pos][0], $listItem->getRefItem()->getType() ); |
|
| 124 | - $this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getContent() ); |
|
| 123 | + $this->assertEquals($expected[$pos][0], $listItem->getRefItem()->getType()); |
|
| 124 | + $this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getContent()); |
|
| 125 | 125 | $pos++; |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -144,21 +144,21 @@ discard block |
||
| 144 | 144 | 1 => 'Short: Job CSV test', |
| 145 | 145 | ); |
| 146 | 146 | |
| 147 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 147 | + $catalog = $this->create('job_csv_test'); |
|
| 148 | 148 | |
| 149 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 150 | - $object->process( $catalog, $data ); |
|
| 151 | - $object->process( $catalog, $dataUpdate ); |
|
| 149 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 150 | + $object->process($catalog, $data); |
|
| 151 | + $object->process($catalog, $dataUpdate); |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | $listItems = $catalog->getListItems(); |
| 155 | - $listItem = reset( $listItems ); |
|
| 155 | + $listItem = reset($listItems); |
|
| 156 | 156 | |
| 157 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 158 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
| 157 | + $this->assertEquals(1, count($listItems)); |
|
| 158 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
| 159 | 159 | |
| 160 | - $this->assertEquals( 'short', $listItem->getRefItem()->getType() ); |
|
| 161 | - $this->assertEquals( 'Short: Job CSV test', $listItem->getRefItem()->getContent() ); |
|
| 160 | + $this->assertEquals('short', $listItem->getRefItem()->getType()); |
|
| 161 | + $this->assertEquals('Short: Job CSV test', $listItem->getRefItem()->getContent()); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
@@ -174,18 +174,18 @@ discard block |
||
| 174 | 174 | 1 => 'Job CSV test', |
| 175 | 175 | ); |
| 176 | 176 | |
| 177 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 177 | + $catalog = $this->create('job_csv_test'); |
|
| 178 | 178 | |
| 179 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 180 | - $object->process( $catalog, $data ); |
|
| 179 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 180 | + $object->process($catalog, $data); |
|
| 181 | 181 | |
| 182 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, [], $this->endpoint ); |
|
| 183 | - $object->process( $catalog, [] ); |
|
| 182 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, [], $this->endpoint); |
|
| 183 | + $object->process($catalog, []); |
|
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | $listItems = $catalog->getListItems(); |
| 187 | 187 | |
| 188 | - $this->assertEquals( 0, count( $listItems ) ); |
|
| 188 | + $this->assertEquals(0, count($listItems)); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -205,15 +205,15 @@ discard block |
||
| 205 | 205 | 3 => '', |
| 206 | 206 | ); |
| 207 | 207 | |
| 208 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 208 | + $catalog = $this->create('job_csv_test'); |
|
| 209 | 209 | |
| 210 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 211 | - $object->process( $catalog, $data ); |
|
| 210 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 211 | + $object->process($catalog, $data); |
|
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | $listItems = $catalog->getListItems(); |
| 215 | 215 | |
| 216 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 216 | + $this->assertEquals(1, count($listItems)); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
@@ -237,26 +237,26 @@ discard block |
||
| 237 | 237 | 5 => 'default', |
| 238 | 238 | ); |
| 239 | 239 | |
| 240 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/text/listtypes', array( 'default' ) ); |
|
| 240 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/text/listtypes', array('default')); |
|
| 241 | 241 | |
| 242 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 242 | + $catalog = $this->create('job_csv_test'); |
|
| 243 | 243 | |
| 244 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 244 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
| 245 | 245 | |
| 246 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
| 247 | - $object->process( $catalog, $data ); |
|
| 246 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
| 247 | + $object->process($catalog, $data); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | 252 | * @param string $code |
| 253 | 253 | */ |
| 254 | - protected function create( $code ) |
|
| 254 | + protected function create($code) |
|
| 255 | 255 | { |
| 256 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
| 256 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
| 257 | 257 | |
| 258 | 258 | $item = $manager->createItem(); |
| 259 | - $item->setCode( $code ); |
|
| 259 | + $item->setCode($code); |
|
| 260 | 260 | |
| 261 | 261 | return $item; |
| 262 | 262 | } |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function setUp() |
| 19 | 19 | { |
| 20 | - \Aimeos\MShop::cache( true ); |
|
| 20 | + \Aimeos\MShop::cache(true); |
|
| 21 | 21 | |
| 22 | 22 | $this->context = \TestHelperCntl::getContext(); |
| 23 | - $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
| 23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done($this->context, []); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - \Aimeos\MShop::cache( false ); |
|
| 29 | + \Aimeos\MShop::cache(false); |
|
| 30 | 30 | \Aimeos\MShop::clear(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -51,32 +51,32 @@ discard block |
||
| 51 | 51 | 5 => 1, |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 54 | + $catalog = $this->create('job_csv_test'); |
|
| 55 | 55 | |
| 56 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 57 | - $object->process( $catalog, $data ); |
|
| 56 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 57 | + $object->process($catalog, $data); |
|
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | $listItems = $catalog->getListItems(); |
| 61 | - $listItem = reset( $listItems ); |
|
| 61 | + $listItem = reset($listItems); |
|
| 62 | 62 | |
| 63 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
| 64 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 63 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
| 64 | + $this->assertEquals(1, count($listItems)); |
|
| 65 | 65 | |
| 66 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
| 67 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
| 68 | - $this->assertEquals( 'media', $listItem->getDomain() ); |
|
| 69 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
| 66 | + $this->assertEquals(1, $listItem->getStatus()); |
|
| 67 | + $this->assertEquals(0, $listItem->getPosition()); |
|
| 68 | + $this->assertEquals('media', $listItem->getDomain()); |
|
| 69 | + $this->assertEquals('default', $listItem->getType()); |
|
| 70 | 70 | |
| 71 | 71 | $refItem = $listItem->getRefItem(); |
| 72 | 72 | |
| 73 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
| 74 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
| 75 | - $this->assertEquals( 'test image', $refItem->getLabel() ); |
|
| 76 | - $this->assertEquals( 'image/jpeg', $refItem->getMimetype() ); |
|
| 77 | - $this->assertEquals( 'path/to/preview', $refItem->getPreview() ); |
|
| 78 | - $this->assertEquals( 'path/to/file', $refItem->getUrl() ); |
|
| 79 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
| 73 | + $this->assertEquals(1, $refItem->getStatus()); |
|
| 74 | + $this->assertEquals('default', $refItem->getType()); |
|
| 75 | + $this->assertEquals('test image', $refItem->getLabel()); |
|
| 76 | + $this->assertEquals('image/jpeg', $refItem->getMimetype()); |
|
| 77 | + $this->assertEquals('path/to/preview', $refItem->getPreview()); |
|
| 78 | + $this->assertEquals('path/to/file', $refItem->getUrl()); |
|
| 79 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -90,21 +90,21 @@ discard block |
||
| 90 | 90 | 0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3", |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 93 | + $catalog = $this->create('job_csv_test'); |
|
| 94 | 94 | |
| 95 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 96 | - $object->process( $catalog, $data ); |
|
| 95 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 96 | + $object->process($catalog, $data); |
|
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | $pos = 0; |
| 100 | 100 | $listItems = $catalog->getListItems(); |
| 101 | - $expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' ); |
|
| 101 | + $expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3'); |
|
| 102 | 102 | |
| 103 | - $this->assertEquals( 4, count( $listItems ) ); |
|
| 103 | + $this->assertEquals(4, count($listItems)); |
|
| 104 | 104 | |
| 105 | - foreach( $listItems as $listItem ) |
|
| 105 | + foreach ($listItems as $listItem) |
|
| 106 | 106 | { |
| 107 | - $this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() ); |
|
| 107 | + $this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl()); |
|
| 108 | 108 | $pos++; |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -126,20 +126,20 @@ discard block |
||
| 126 | 126 | 3 => 'path/to/3', |
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 129 | + $catalog = $this->create('job_csv_test'); |
|
| 130 | 130 | |
| 131 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 132 | - $object->process( $catalog, $data ); |
|
| 131 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 132 | + $object->process($catalog, $data); |
|
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | $pos = 0; |
| 136 | 136 | $listItems = $catalog->getListItems(); |
| 137 | 137 | |
| 138 | - $this->assertEquals( 4, count( $listItems ) ); |
|
| 138 | + $this->assertEquals(4, count($listItems)); |
|
| 139 | 139 | |
| 140 | - foreach( $listItems as $listItem ) |
|
| 140 | + foreach ($listItems as $listItem) |
|
| 141 | 141 | { |
| 142 | - $this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() ); |
|
| 142 | + $this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl()); |
|
| 143 | 143 | $pos++; |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -162,21 +162,21 @@ discard block |
||
| 162 | 162 | 1 => '', |
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 165 | + $catalog = $this->create('job_csv_test'); |
|
| 166 | 166 | |
| 167 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 168 | - $object->process( $catalog, $data ); |
|
| 169 | - $object->process( $catalog, $dataUpdate ); |
|
| 167 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 168 | + $object->process($catalog, $data); |
|
| 169 | + $object->process($catalog, $dataUpdate); |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | $listItems = $catalog->getListItems(); |
| 173 | - $listItem = reset( $listItems ); |
|
| 173 | + $listItem = reset($listItems); |
|
| 174 | 174 | |
| 175 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 176 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
| 175 | + $this->assertEquals(1, count($listItems)); |
|
| 176 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
| 177 | 177 | |
| 178 | - $this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() ); |
|
| 179 | - $this->assertEquals( null, $listItem->getRefItem()->getLanguageId() ); |
|
| 178 | + $this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl()); |
|
| 179 | + $this->assertEquals(null, $listItem->getRefItem()->getLanguageId()); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | 0 => '/path/to/file', |
| 191 | 191 | ); |
| 192 | 192 | |
| 193 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 193 | + $catalog = $this->create('job_csv_test'); |
|
| 194 | 194 | |
| 195 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 196 | - $object->process( $catalog, $data ); |
|
| 195 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 196 | + $object->process($catalog, $data); |
|
| 197 | 197 | |
| 198 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint ); |
|
| 199 | - $object->process( $catalog, [] ); |
|
| 198 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint); |
|
| 199 | + $object->process($catalog, []); |
|
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | $listItems = $catalog->getListItems(); |
| 203 | 203 | |
| 204 | - $this->assertEquals( 0, count( $listItems ) ); |
|
| 204 | + $this->assertEquals(0, count($listItems)); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
@@ -217,15 +217,15 @@ discard block |
||
| 217 | 217 | 1 => '', |
| 218 | 218 | ); |
| 219 | 219 | |
| 220 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 220 | + $catalog = $this->create('job_csv_test'); |
|
| 221 | 221 | |
| 222 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 223 | - $object->process( $catalog, $data ); |
|
| 222 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 223 | + $object->process($catalog, $data); |
|
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | $listItems = $catalog->getListItems(); |
| 227 | 227 | |
| 228 | - $this->assertEquals( 1, count( $listItems ) ); |
|
| 228 | + $this->assertEquals(1, count($listItems)); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
@@ -245,26 +245,26 @@ discard block |
||
| 245 | 245 | 3 => 'default', |
| 246 | 246 | ); |
| 247 | 247 | |
| 248 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/media/listtypes', array( 'default' ) ); |
|
| 248 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/media/listtypes', array('default')); |
|
| 249 | 249 | |
| 250 | - $catalog = $this->create( 'job_csv_test' ); |
|
| 250 | + $catalog = $this->create('job_csv_test'); |
|
| 251 | 251 | |
| 252 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 252 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
| 253 | 253 | |
| 254 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
| 255 | - $object->process( $catalog, $data ); |
|
| 254 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
| 255 | + $object->process($catalog, $data); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * @param string $code |
| 261 | 261 | */ |
| 262 | - protected function create( $code ) |
|
| 262 | + protected function create($code) |
|
| 263 | 263 | { |
| 264 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
| 264 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
| 265 | 265 | |
| 266 | 266 | $item = $manager->createItem(); |
| 267 | - $item->setCode( $code ); |
|
| 267 | + $item->setCode($code); |
|
| 268 | 268 | |
| 269 | 269 | return $item; |
| 270 | 270 | } |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function setUp() |
| 19 | 19 | { |
| 20 | - \Aimeos\MShop::cache( true ); |
|
| 20 | + \Aimeos\MShop::cache(true); |
|
| 21 | 21 | |
| 22 | 22 | $this->context = \TestHelperCntl::getContext(); |
| 23 | - $this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done( $this->context, [] ); |
|
| 23 | + $this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done($this->context, []); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | protected function tearDown() |
| 28 | 28 | { |
| 29 | - \Aimeos\MShop::cache( false ); |
|
| 29 | + \Aimeos\MShop::cache(false); |
|
| 30 | 30 | \Aimeos\MShop::clear(); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -47,24 +47,24 @@ discard block |
||
| 47 | 47 | 3 => '', |
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' ); |
|
| 51 | - $codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' ); |
|
| 50 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon'); |
|
| 51 | + $codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code'); |
|
| 52 | 52 | |
| 53 | - $coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) ); |
|
| 53 | + $coupon = $manager->saveItem($manager->createItem()->setProvider('test')); |
|
| 54 | 54 | $couponCode = $codeManager->createItem(); |
| 55 | - $couponCode->setParentId( $coupon->getId() ); |
|
| 55 | + $couponCode->setParentId($coupon->getId()); |
|
| 56 | 56 | |
| 57 | - $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 58 | - $object->process( $couponCode, $data ); |
|
| 57 | + $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint); |
|
| 58 | + $object->process($couponCode, $data); |
|
| 59 | 59 | |
| 60 | - $codeManager->deleteItem( $couponCode->getId() ); |
|
| 61 | - $manager->deleteItem( $coupon->getId() ); |
|
| 60 | + $codeManager->deleteItem($couponCode->getId()); |
|
| 61 | + $manager->deleteItem($coupon->getId()); |
|
| 62 | 62 | |
| 63 | 63 | |
| 64 | - $this->assertEquals( 10, $couponCode->getCount() ); |
|
| 65 | - $this->assertEquals( 'jobimporttest', $couponCode->getCode() ); |
|
| 66 | - $this->assertEquals( '2000-01-01 00:00:00', $couponCode->getDateStart() ); |
|
| 67 | - $this->assertEquals( null, $couponCode->getDateEnd() ); |
|
| 64 | + $this->assertEquals(10, $couponCode->getCount()); |
|
| 65 | + $this->assertEquals('jobimporttest', $couponCode->getCode()); |
|
| 66 | + $this->assertEquals('2000-01-01 00:00:00', $couponCode->getDateStart()); |
|
| 67 | + $this->assertEquals(null, $couponCode->getDateEnd()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -86,23 +86,23 @@ discard block |
||
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | 88 | |
| 89 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' ); |
|
| 90 | - $codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' ); |
|
| 89 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon'); |
|
| 90 | + $codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code'); |
|
| 91 | 91 | |
| 92 | - $coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) ); |
|
| 92 | + $coupon = $manager->saveItem($manager->createItem()->setProvider('test')); |
|
| 93 | 93 | $couponCode = $codeManager->createItem(); |
| 94 | - $couponCode->setParentId( $coupon->getId() ); |
|
| 94 | + $couponCode->setParentId($coupon->getId()); |
|
| 95 | 95 | |
| 96 | - $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 97 | - $object->process( $couponCode, $data ); |
|
| 98 | - $object->process( $couponCode, $dataUpdate ); |
|
| 96 | + $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint); |
|
| 97 | + $object->process($couponCode, $data); |
|
| 98 | + $object->process($couponCode, $dataUpdate); |
|
| 99 | 99 | |
| 100 | - $codeManager->deleteItem( $couponCode->getId() ); |
|
| 101 | - $manager->deleteItem( $coupon->getId() ); |
|
| 100 | + $codeManager->deleteItem($couponCode->getId()); |
|
| 101 | + $manager->deleteItem($coupon->getId()); |
|
| 102 | 102 | |
| 103 | 103 | |
| 104 | - $this->assertEquals( 5, $couponCode->getCount() ); |
|
| 105 | - $this->assertEquals( 'jobimporttest', $couponCode->getCode() ); |
|
| 104 | + $this->assertEquals(5, $couponCode->getCount()); |
|
| 105 | + $this->assertEquals('jobimporttest', $couponCode->getCode()); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -119,20 +119,20 @@ discard block |
||
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | |
| 122 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' ); |
|
| 123 | - $codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' ); |
|
| 122 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon'); |
|
| 123 | + $codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code'); |
|
| 124 | 124 | |
| 125 | - $coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) ); |
|
| 125 | + $coupon = $manager->saveItem($manager->createItem()->setProvider('test')); |
|
| 126 | 126 | $couponCode = $codeManager->createItem(); |
| 127 | - $couponCode->setParentId( $coupon->getId() ); |
|
| 127 | + $couponCode->setParentId($coupon->getId()); |
|
| 128 | 128 | |
| 129 | - $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint ); |
|
| 130 | - $object->process( $couponCode, $data ); |
|
| 129 | + $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint); |
|
| 130 | + $object->process($couponCode, $data); |
|
| 131 | 131 | |
| 132 | - $codeManager->deleteItem( $couponCode->getId() ); |
|
| 133 | - $manager->deleteItem( $coupon->getId() ); |
|
| 132 | + $codeManager->deleteItem($couponCode->getId()); |
|
| 133 | + $manager->deleteItem($coupon->getId()); |
|
| 134 | 134 | |
| 135 | 135 | |
| 136 | - $this->assertEquals( 0, $couponCode->getCount() ); |
|
| 136 | + $this->assertEquals(0, $couponCode->getCount()); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | \ No newline at end of file |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | protected function setUp() |
| 14 | 14 | { |
| 15 | - \Aimeos\MShop::cache( true ); |
|
| 15 | + \Aimeos\MShop::cache(true); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | protected function tearDown() |
| 20 | 20 | { |
| 21 | - \Aimeos\MShop::cache( false ); |
|
| 21 | + \Aimeos\MShop::cache(false); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
@@ -26,29 +26,29 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $context = \TestHelperCntl::getContext(); |
| 28 | 28 | |
| 29 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
| 29 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
| 30 | 30 | |
| 31 | - $fcn = function( $subject ){ |
|
| 31 | + $fcn = function($subject) { |
|
| 32 | 32 | return $subject->getGroups() === ['1', '2']; |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 36 | - ->setConstructorArgs( [$context] ) |
|
| 37 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
| 35 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 36 | + ->setConstructorArgs([$context]) |
|
| 37 | + ->setMethods(['getItem', 'saveItem']) |
|
| 38 | 38 | ->getMock(); |
| 39 | 39 | |
| 40 | - \Aimeos\MShop::inject( $context, 'customer', $customerStub ); |
|
| 40 | + \Aimeos\MShop::inject($context, 'customer', $customerStub); |
|
| 41 | 41 | |
| 42 | 42 | $customerItem = $customerStub->createItem(); |
| 43 | 43 | |
| 44 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
| 45 | - ->will( $this->returnValue( $customerItem ) ); |
|
| 44 | + $customerStub->expects($this->once())->method('getItem') |
|
| 45 | + ->will($this->returnValue($customerItem)); |
|
| 46 | 46 | |
| 47 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
| 48 | - ->with( $this->callback( $fcn ) ); |
|
| 47 | + $customerStub->expects($this->once())->method('saveItem') |
|
| 48 | + ->with($this->callback($fcn)); |
|
| 49 | 49 | |
| 50 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
| 51 | - $object->begin( $this->getSubscription( $context ) ); |
|
| 50 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
| 51 | + $object->begin($this->getSubscription($context)); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -56,45 +56,45 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $context = \TestHelperCntl::getContext(); |
| 58 | 58 | |
| 59 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
| 59 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
| 60 | 60 | |
| 61 | - $fcn = function( $subject ){ |
|
| 61 | + $fcn = function($subject) { |
|
| 62 | 62 | return $subject->getGroups() === []; |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
| 66 | - ->setConstructorArgs( [$context] ) |
|
| 67 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
| 65 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
| 66 | + ->setConstructorArgs([$context]) |
|
| 67 | + ->setMethods(['getItem', 'saveItem']) |
|
| 68 | 68 | ->getMock(); |
| 69 | 69 | |
| 70 | - \Aimeos\MShop::inject( $context, 'customer', $customerStub ); |
|
| 70 | + \Aimeos\MShop::inject($context, 'customer', $customerStub); |
|
| 71 | 71 | |
| 72 | - $customerItem = $customerStub->createItem()->setGroups( ['1', '2'] ); |
|
| 72 | + $customerItem = $customerStub->createItem()->setGroups(['1', '2']); |
|
| 73 | 73 | |
| 74 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
| 75 | - ->will( $this->returnValue( $customerItem ) ); |
|
| 74 | + $customerStub->expects($this->once())->method('getItem') |
|
| 75 | + ->will($this->returnValue($customerItem)); |
|
| 76 | 76 | |
| 77 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
| 78 | - ->with( $this->callback( $fcn ) ); |
|
| 77 | + $customerStub->expects($this->once())->method('saveItem') |
|
| 78 | + ->with($this->callback($fcn)); |
|
| 79 | 79 | |
| 80 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
| 81 | - $object->end( $this->getSubscription( $context ) ); |
|
| 80 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
| 81 | + $object->end($this->getSubscription($context)); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | - protected function getSubscription( $context ) |
|
| 85 | + protected function getSubscription($context) |
|
| 86 | 86 | { |
| 87 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'subscription' ); |
|
| 87 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'subscription'); |
|
| 88 | 88 | |
| 89 | 89 | $search = $manager->createSearch(); |
| 90 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
| 90 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
| 91 | 91 | |
| 92 | - $items = $manager->searchItems( $search ); |
|
| 92 | + $items = $manager->searchItems($search); |
|
| 93 | 93 | |
| 94 | - if( ( $item = reset( $items ) ) !== false ) { |
|
| 94 | + if (($item = reset($items)) !== false) { |
|
| 95 | 95 | return $item; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - throw new \Exception( 'No subscription item found' ); |
|
| 98 | + throw new \Exception('No subscription item found'); |
|
| 99 | 99 | } |
| 100 | 100 | } |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | public static function bootstrap() |
| 16 | 16 | { |
| 17 | 17 | self::getAimeos(); |
| 18 | - \Aimeos\MShop::cache( false ); |
|
| 18 | + \Aimeos\MShop::cache(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,7 +47,7 @@ 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(); |
@@ -57,30 +57,30 @@ discard block |
||
| 57 | 57 | $paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config'; |
| 58 | 58 | $file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser'; |
| 59 | 59 | |
| 60 | - $conf = new \Aimeos\MW\Config\PHPArray( [], $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([], $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 | } |