@@ -18,18 +18,18 @@ discard block |
||
18 | 18 | |
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | - \Aimeos\MShop\Factory::setCache( true ); |
|
21 | + \Aimeos\MShop\Factory::setCache(true); |
|
22 | 22 | |
23 | 23 | $this->context = \TestHelperJobs::getContext(); |
24 | 24 | $this->aimeos = \TestHelperJobs::getAimeos(); |
25 | 25 | |
26 | - $this->object = new \Aimeos\Controller\Jobs\Product\Export\Sitemap\Standard( $this->context, $this->aimeos ); |
|
26 | + $this->object = new \Aimeos\Controller\Jobs\Product\Export\Sitemap\Standard($this->context, $this->aimeos); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - \Aimeos\MShop\Factory::setCache( false ); |
|
32 | + \Aimeos\MShop\Factory::setCache(false); |
|
33 | 33 | \Aimeos\MShop\Factory::clear(); |
34 | 34 | |
35 | 35 | $this->object = null; |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | |
39 | 39 | public function testGetName() |
40 | 40 | { |
41 | - $this->assertEquals( 'Product site map', $this->object->getName() ); |
|
41 | + $this->assertEquals('Product site map', $this->object->getName()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testGetDescription() |
46 | 46 | { |
47 | 47 | $text = 'Creates a product site map for search engines'; |
48 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
48 | + $this->assertEquals($text, $this->object->getDescription()); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -54,22 +54,22 @@ discard block |
||
54 | 54 | $this->object->run(); |
55 | 55 | |
56 | 56 | $ds = DIRECTORY_SEPARATOR; |
57 | - $this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz' ); |
|
58 | - $this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz' ); |
|
59 | - $this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz' ); |
|
57 | + $this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-1.xml.gz'); |
|
58 | + $this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-2.xml.gz'); |
|
59 | + $this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-index.xml.gz'); |
|
60 | 60 | |
61 | - $file1 = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz', 'rb' ), 0x1000 ); |
|
62 | - $file2 = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz', 'rb' ), 0x1000 ); |
|
63 | - $index = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz', 'rb' ), 0x1000 ); |
|
61 | + $file1 = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-1.xml.gz', 'rb'), 0x1000); |
|
62 | + $file2 = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-2.xml.gz', 'rb'), 0x1000); |
|
63 | + $index = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-index.xml.gz', 'rb'), 0x1000); |
|
64 | 64 | |
65 | - unlink( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz' ); |
|
66 | - unlink( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz' ); |
|
67 | - unlink( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz' ); |
|
65 | + unlink('tmp' . $ds . 'aimeos-sitemap-1.xml.gz'); |
|
66 | + unlink('tmp' . $ds . 'aimeos-sitemap-2.xml.gz'); |
|
67 | + unlink('tmp' . $ds . 'aimeos-sitemap-index.xml.gz'); |
|
68 | 68 | |
69 | - $this->assertContains( 'Cafe_Noire_Expresso', $file1 ); |
|
70 | - $this->assertContains( 'Unittest%3A_Bundle', $file2 ); |
|
69 | + $this->assertContains('Cafe_Noire_Expresso', $file1); |
|
70 | + $this->assertContains('Unittest%3A_Bundle', $file2); |
|
71 | 71 | |
72 | - $this->assertContains( 'aimeos-sitemap-1.xml.gz', $index ); |
|
73 | - $this->assertContains( 'aimeos-sitemap-2.xml.gz', $index ); |
|
72 | + $this->assertContains('aimeos-sitemap-1.xml.gz', $index); |
|
73 | + $this->assertContains('aimeos-sitemap-2.xml.gz', $index); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -19,18 +19,18 @@ discard block |
||
19 | 19 | |
20 | 20 | protected function setUp() |
21 | 21 | { |
22 | - \Aimeos\MShop\Factory::setCache( true ); |
|
22 | + \Aimeos\MShop\Factory::setCache(true); |
|
23 | 23 | |
24 | 24 | $this->context = \TestHelperJobs::getContext(); |
25 | 25 | $this->aimeos = \TestHelperJobs::getAimeos(); |
26 | 26 | |
27 | - $this->object = new \Aimeos\Controller\Jobs\Product\Bought\Standard( $this->context, $this->aimeos ); |
|
27 | + $this->object = new \Aimeos\Controller\Jobs\Product\Bought\Standard($this->context, $this->aimeos); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - \Aimeos\MShop\Factory::setCache( false ); |
|
33 | + \Aimeos\MShop\Factory::setCache(false); |
|
34 | 34 | \Aimeos\MShop\Factory::clear(); |
35 | 35 | |
36 | 36 | $this->object = null; |
@@ -39,28 +39,28 @@ discard block |
||
39 | 39 | |
40 | 40 | public function testGetName() |
41 | 41 | { |
42 | - $this->assertEquals( 'Products bought together', $this->object->getName() ); |
|
42 | + $this->assertEquals('Products bought together', $this->object->getName()); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | public function testGetDescription() |
47 | 47 | { |
48 | 48 | $text = 'Creates bought together product suggestions'; |
49 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
49 | + $this->assertEquals($text, $this->object->getDescription()); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | public function testRun() |
54 | 54 | { |
55 | - $stub = $this->getMockBuilder( '\\Aimeos\\MShop\\Product\\Manager\\Lists\\Standard' ) |
|
56 | - ->setConstructorArgs( array( $this->context ) ) |
|
57 | - ->setMethods( array( 'deleteItems', 'saveItem' ) ) |
|
55 | + $stub = $this->getMockBuilder('\\Aimeos\\MShop\\Product\\Manager\\Lists\\Standard') |
|
56 | + ->setConstructorArgs(array($this->context)) |
|
57 | + ->setMethods(array('deleteItems', 'saveItem')) |
|
58 | 58 | ->getMock(); |
59 | 59 | |
60 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'product/lists', $stub ); |
|
60 | + \Aimeos\MShop\Factory::injectManager($this->context, 'product/lists', $stub); |
|
61 | 61 | |
62 | - $stub->expects( $this->atLeastOnce() )->method( 'deleteItems' ); |
|
63 | - $stub->expects( $this->atLeastOnce() )->method( 'saveItem' ); |
|
62 | + $stub->expects($this->atLeastOnce())->method('deleteItems'); |
|
63 | + $stub->expects($this->atLeastOnce())->method('saveItem'); |
|
64 | 64 | |
65 | 65 | $this->object->run(); |
66 | 66 | } |
@@ -18,102 +18,102 @@ |
||
18 | 18 | |
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | - \Aimeos\MShop\Factory::setCache( true ); |
|
21 | + \Aimeos\MShop\Factory::setCache(true); |
|
22 | 22 | |
23 | 23 | $this->context = \TestHelperJobs::getContext(); |
24 | 24 | $this->aimeos = \TestHelperJobs::getAimeos(); |
25 | 25 | $config = $this->context->getConfig(); |
26 | 26 | |
27 | - $config->set( 'controller/jobs/product/import/csv/skip-lines', 1 ); |
|
27 | + $config->set('controller/jobs/product/import/csv/skip-lines', 1); |
|
28 | 28 | |
29 | - $this->object = new \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Standard( $this->context, $this->aimeos ); |
|
29 | + $this->object = new \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Standard($this->context, $this->aimeos); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | protected function tearDown() |
34 | 34 | { |
35 | - \Aimeos\MShop\Factory::setCache( false ); |
|
35 | + \Aimeos\MShop\Factory::setCache(false); |
|
36 | 36 | \Aimeos\MShop\Factory::clear(); |
37 | 37 | |
38 | - unset( $this->object ); |
|
38 | + unset($this->object); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testGetName() |
43 | 43 | { |
44 | - $this->assertEquals( 'Coupon code import CSV', $this->object->getName() ); |
|
44 | + $this->assertEquals('Coupon code import CSV', $this->object->getName()); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testGetDescription() |
49 | 49 | { |
50 | 50 | $text = 'Imports new and updates existing coupon code from CSV files'; |
51 | - $this->assertEquals( $text, $this->object->getDescription() ); |
|
51 | + $this->assertEquals($text, $this->object->getDescription()); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | 55 | public function testRun() |
56 | 56 | { |
57 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' ); |
|
58 | - $coupon = $manager->saveItem( $manager->createItem()->setProvider( 'Example' ) ); |
|
57 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon'); |
|
58 | + $coupon = $manager->saveItem($manager->createItem()->setProvider('Example')); |
|
59 | 59 | |
60 | 60 | $dir = 'tmp/import/couponcode/unittest'; |
61 | 61 | $filepath = $dir . '/' . $coupon->getId() . '.csv'; |
62 | 62 | |
63 | - if( !is_dir( $dir ) && mkdir( 'tmp/import/couponcode/unittest', 0775, true ) === false ) { |
|
64 | - throw new \Exception( sprintf( 'Unable to create directory "%1$s"', $dir ) ); |
|
63 | + if (!is_dir($dir) && mkdir('tmp/import/couponcode/unittest', 0775, true) === false) { |
|
64 | + throw new \Exception(sprintf('Unable to create directory "%1$s"', $dir)); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $content = 'code,count,start,end |
68 | 68 | jobccimport1,3,2000-01-01 00:00:00, |
69 | 69 | jobccimport2,5,,'; |
70 | 70 | |
71 | - if( file_put_contents( $filepath, $content ) === false ) { |
|
72 | - throw new \Exception( sprintf( 'Unable to create file "%1$s"', $file ) ); |
|
71 | + if (file_put_contents($filepath, $content) === false) { |
|
72 | + throw new \Exception(sprintf('Unable to create file "%1$s"', $file)); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $this->object->run(); |
76 | 76 | |
77 | 77 | |
78 | - unlink( $filepath ); |
|
78 | + unlink($filepath); |
|
79 | 79 | |
80 | - $codeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon/code' ); |
|
81 | - $code1 = $codeManager->findItem( 'jobccimport1' ); |
|
82 | - $code2 = $codeManager->findItem( 'jobccimport2' ); |
|
80 | + $codeManager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon/code'); |
|
81 | + $code1 = $codeManager->findItem('jobccimport1'); |
|
82 | + $code2 = $codeManager->findItem('jobccimport2'); |
|
83 | 83 | |
84 | - $manager->deleteItem( $coupon->getId() ); |
|
84 | + $manager->deleteItem($coupon->getId()); |
|
85 | 85 | |
86 | - $this->assertEquals( 3, $code1->getCount() ); |
|
87 | - $this->assertEquals( '2000-01-01 00:00:00', $code1->getDateStart() ); |
|
88 | - $this->assertEquals( null, $code1->getDateEnd() ); |
|
86 | + $this->assertEquals(3, $code1->getCount()); |
|
87 | + $this->assertEquals('2000-01-01 00:00:00', $code1->getDateStart()); |
|
88 | + $this->assertEquals(null, $code1->getDateEnd()); |
|
89 | 89 | |
90 | - $this->assertEquals( 5, $code2->getCount() ); |
|
91 | - $this->assertEquals( null, $code2->getDateStart() ); |
|
92 | - $this->assertEquals( null, $code2->getDateEnd() ); |
|
90 | + $this->assertEquals(5, $code2->getCount()); |
|
91 | + $this->assertEquals(null, $code2->getDateStart()); |
|
92 | + $this->assertEquals(null, $code2->getDateEnd()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
96 | 96 | public function testRunException() |
97 | 97 | { |
98 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'coupon' ); |
|
99 | - $coupon = $manager->saveItem( $manager->createItem()->setProvider( 'Example' ) ); |
|
98 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'coupon'); |
|
99 | + $coupon = $manager->saveItem($manager->createItem()->setProvider('Example')); |
|
100 | 100 | |
101 | 101 | $dir = 'tmp/import/couponcode/unittest'; |
102 | 102 | $filepath = $dir . '/0.csv'; |
103 | 103 | |
104 | - if( !is_dir( $dir ) && mkdir( 'tmp/import/couponcode/unittest', 0775, true ) === false ) { |
|
105 | - throw new \Exception( sprintf( 'Unable to create directory "%1$s"', $dir ) ); |
|
104 | + if (!is_dir($dir) && mkdir('tmp/import/couponcode/unittest', 0775, true) === false) { |
|
105 | + throw new \Exception(sprintf('Unable to create directory "%1$s"', $dir)); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $content = 'code,count,start,end |
109 | 109 | jobccimport1,,,'; |
110 | 110 | |
111 | - if( file_put_contents( $filepath, $content ) === false ) { |
|
112 | - throw new \Exception( sprintf( 'Unable to create file "%1$s"', $file ) ); |
|
111 | + if (file_put_contents($filepath, $content) === false) { |
|
112 | + throw new \Exception(sprintf('Unable to create file "%1$s"', $file)); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | $this->object->run(); |
116 | 116 | |
117 | - unlink( $filepath ); |
|
117 | + unlink($filepath); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | \ No newline at end of file |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | $context = \TestHelperJobs::getContext(); |
17 | 17 | $aimeos = \TestHelperJobs::getAimeos(); |
18 | 18 | |
19 | - $obj = \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController( $context, $aimeos ); |
|
20 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
19 | + $obj = \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController($context, $aimeos); |
|
20 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Jobs\\Iface', $obj); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $context = \TestHelperJobs::getContext(); |
27 | 27 | $aimeos = \TestHelperJobs::getAimeos(); |
28 | 28 | |
29 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
30 | - \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController( $context, $aimeos, 'Wrong$$$Name' ); |
|
29 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
30 | + \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController($context, $aimeos, 'Wrong$$$Name'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | $context = \TestHelperJobs::getContext(); |
37 | 37 | $aimeos = \TestHelperJobs::getAimeos(); |
38 | 38 | |
39 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
40 | - \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController( $context, $aimeos, 'WrongClass' ); |
|
39 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
40 | + \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController($context, $aimeos, 'WrongClass'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $context = \TestHelperJobs::getContext(); |
47 | 47 | $aimeos = \TestHelperJobs::getAimeos(); |
48 | 48 | |
49 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
50 | - \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController( $context, $aimeos, 'Factory' ); |
|
49 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
50 | + \Aimeos\Controller\Jobs\Coupon\Import\Csv\Code\Factory::createController($context, $aimeos, 'Factory'); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |