@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'manager' => array ( |
|
4 | + 'manager' => array( |
|
5 | 5 | 'default' => array( |
6 | 6 | 'select' => 'select1', |
7 | 7 | ), |
8 | 8 | ), |
9 | 9 | 'provider' => array( |
10 | - 'delivery' => array ( |
|
10 | + 'delivery' => array( |
|
11 | 11 | 'sh' => array( |
12 | 12 | 'select' => 'select2', |
13 | 13 | ), |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'subsubitem' => array ( |
|
4 | + 'subsubitem' => array( |
|
5 | 5 | 'aa' => array( |
6 | 6 | 'aaa' => '111', |
7 | 7 | ), |
8 | 8 | ), |
9 | 9 | 'subsubblablub' => array( |
10 | - 'bb' => array ( |
|
10 | + 'bb' => array( |
|
11 | 11 | 'bbb' => '222', |
12 | 12 | ), |
13 | 13 | ), |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'subitem' => array ( |
|
4 | + 'subitem' => array( |
|
5 | 5 | 'a' => array( |
6 | 6 | 'aa' => '11', |
7 | 7 | ), |
8 | 8 | ), |
9 | 9 | 'subbla' => array( |
10 | - 'b' => array ( |
|
10 | + 'b' => array( |
|
11 | 11 | 'bb' => '22', |
12 | 12 | ), |
13 | 13 | ), |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function setUp() |
25 | 25 | { |
26 | - $dir = __DIR__ . DIRECTORY_SEPARATOR . 'testfiles'; |
|
27 | - $dir2 = __DIR__ . DIRECTORY_SEPARATOR . 'testowrite'; |
|
26 | + $dir = __DIR__.DIRECTORY_SEPARATOR.'testfiles'; |
|
27 | + $dir2 = __DIR__.DIRECTORY_SEPARATOR.'testowrite'; |
|
28 | 28 | |
29 | 29 | $conf = array( 'resource' => array( 'db' => array( 'host' => '127.0.0.1' ) ) ); |
30 | 30 | $this->object = new \Aimeos\MW\Config\PHPArray( $conf, array( $dir, $dir2 ) ); |
@@ -44,34 +44,34 @@ discard block |
||
44 | 44 | { |
45 | 45 | $this->assertEquals( '127.0.0.1', $this->object->get( 'resource/db/host' ) ); |
46 | 46 | |
47 | - $x = $this->object->get( 'config/manager/default/select', 'defvalue1'); |
|
47 | + $x = $this->object->get( 'config/manager/default/select', 'defvalue1' ); |
|
48 | 48 | $this->assertEquals( 'select11', $x ); |
49 | 49 | |
50 | - $x = $this->object->get( 'config/provider/delivery/sh/select', 'defvalue2'); |
|
50 | + $x = $this->object->get( 'config/provider/delivery/sh/select', 'defvalue2' ); |
|
51 | 51 | $this->assertEquals( 'select2', $x ); |
52 | 52 | |
53 | - $x = $this->object->get( 'subconfig/default/subitem/a/aa', 'defvalue3'); |
|
53 | + $x = $this->object->get( 'subconfig/default/subitem/a/aa', 'defvalue3' ); |
|
54 | 54 | $this->assertEquals( '111', $x ); |
55 | 55 | |
56 | - $x = $this->object->get( 'subconfig/subsubconfig/default/subsubitem/aa/aaa', 'defvalue4'); |
|
56 | + $x = $this->object->get( 'subconfig/subsubconfig/default/subsubitem/aa/aaa', 'defvalue4' ); |
|
57 | 57 | $this->assertEquals( '111', $x ); |
58 | 58 | |
59 | - $x = $this->object->get( 'config/manager/default/select', 'defvalue5'); |
|
59 | + $x = $this->object->get( 'config/manager/default/select', 'defvalue5' ); |
|
60 | 60 | $this->assertEquals( 'select11', $x ); |
61 | 61 | |
62 | - $x = $this->object->get( 'subconfig/subsubconfig/default/subsubitem/aa/aaa', 'defvalue6'); |
|
62 | + $x = $this->object->get( 'subconfig/subsubconfig/default/subsubitem/aa/aaa', 'defvalue6' ); |
|
63 | 63 | $this->assertEquals( '111', $x ); |
64 | 64 | |
65 | - $x = $this->object->get( 'subconfig/default/subitem/a/aa', 'defvalue7'); |
|
65 | + $x = $this->object->get( 'subconfig/default/subitem/a/aa', 'defvalue7' ); |
|
66 | 66 | $this->assertEquals( '111', $x ); |
67 | 67 | |
68 | - $x = $this->object->get( 'subconfig/default/subitem/a/bb', 'defvalue8'); |
|
68 | + $x = $this->object->get( 'subconfig/default/subitem/a/bb', 'defvalue8' ); |
|
69 | 69 | $this->assertEquals( 'defvalue8', $x ); |
70 | 70 | |
71 | - $x = $this->object->get( 'nonsubconfig', 'defvalue9'); |
|
71 | + $x = $this->object->get( 'nonsubconfig', 'defvalue9' ); |
|
72 | 72 | $this->assertEquals( 'defvalue9', $x ); |
73 | 73 | |
74 | - $x = $this->object->get( 'subconfig', 'defvalue10'); |
|
74 | + $x = $this->object->get( 'subconfig', 'defvalue10' ); |
|
75 | 75 | $this->assertInternalType( 'array', $x ); |
76 | 76 | } |
77 | 77 | |
@@ -81,13 +81,13 @@ discard block |
||
81 | 81 | |
82 | 82 | $this->assertEquals( |
83 | 83 | array( |
84 | - 'subitem' => array ( |
|
84 | + 'subitem' => array( |
|
85 | 85 | 'a' => array( |
86 | 86 | 'aa' => '111', |
87 | 87 | ), |
88 | 88 | ), |
89 | 89 | 'subbla' => array( |
90 | - 'b' => array ( |
|
90 | + 'b' => array( |
|
91 | 91 | 'bb' => '22', |
92 | 92 | ), |
93 | 93 | ), |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | $lcList = array( |
111 | 111 | 0 => array( |
112 | - 'am', 'ar','bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv','mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
112 | + 'am', 'ar', 'bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv', 'mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
113 | 113 | ), |
114 | 114 | 1 => array( |
115 | 115 | 'af', 'az', 'bn', 'bg', 'ca', 'da', 'de', 'el', 'en', 'eo', 'es', |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | $ds = DIRECTORY_SEPARATOR; |
27 | 27 | |
28 | 28 | $translationSources = array( |
29 | - 'testDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case1' ), |
|
30 | - 'otherTestDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case2' ), // no file for ru_XX! |
|
31 | - 'thirdtestDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case3' ), |
|
29 | + 'testDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case1' ), |
|
30 | + 'otherTestDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case2' ), // no file for ru_XX! |
|
31 | + 'thirdtestDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case3' ), |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | $this->object = new \Aimeos\MW\Translation\SerializedArray( $translationSources, 'ru_XX' ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function testAbstractGetTranslationFileFallback() |
88 | 88 | { |
89 | 89 | $ds = DIRECTORY_SEPARATOR; |
90 | - $srcs = array( 'testDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case1' ) ); |
|
90 | + $srcs = array( 'testDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case1' ) ); |
|
91 | 91 | $object = new \Aimeos\MW\Translation\SerializedArray( $srcs, 'de_DE' ); |
92 | 92 | |
93 | 93 | $this->assertEquals( 'plural 1 translation', $object->dn( 'testDomain', 'File', 'Files', 5 ) ); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function testAbstractGetTranslationFileFallbackNoFile() |
100 | 100 | { |
101 | 101 | $ds = DIRECTORY_SEPARATOR; |
102 | - $srcs = array( 'otherTestDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case2' ) ); |
|
102 | + $srcs = array( 'otherTestDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case2' ) ); |
|
103 | 103 | $object = new \Aimeos\MW\Translation\SerializedArray( $srcs, 'de' ); |
104 | 104 | |
105 | 105 | $this->assertEquals( 'Test default return', $object->dt( 'otherTestDomain', 'Test default return' ) ); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public function testAbstractGetTranslationFileFallbackInvalidLocale() |
110 | 110 | { |
111 | 111 | $ds = DIRECTORY_SEPARATOR; |
112 | - $srcs = array( 'otherTestDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case2' ) ); |
|
112 | + $srcs = array( 'otherTestDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case2' ) ); |
|
113 | 113 | $object = new \Aimeos\MW\Translation\SerializedArray( $srcs, 'xx_XX' ); |
114 | 114 | |
115 | 115 | $this->assertEquals( 'Test default return', $object->dt( 'otherTestDomain', 'Test default return' ) ); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $lcList = array( |
124 | 124 | 0 => array( |
125 | - 'am', 'ar','bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv','mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
125 | + 'am', 'ar', 'bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv', 'mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
126 | 126 | ), |
127 | 127 | 1 => array( |
128 | 128 | 'af', 'az', 'bn', 'bg', 'ca', 'da', 'de', 'el', 'en', 'eo', 'es', |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | ); |
137 | 137 | |
138 | 138 | $ds = DIRECTORY_SEPARATOR; |
139 | - $srcs = array( 'testDomain' => array( __DIR__ . $ds . 'testfiles' . $ds . 'case1' ) ); |
|
139 | + $srcs = array( 'testDomain' => array( __DIR__.$ds.'testfiles'.$ds.'case1' ) ); |
|
140 | 140 | |
141 | 141 | foreach( $lcList as $index => $lcs ) |
142 | 142 | { |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | { |
39 | 39 | $p = new TestPublisher(); |
40 | 40 | |
41 | - $this->object->register($p); |
|
41 | + $this->object->register( $p ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function testUpdate() |
45 | 45 | { |
46 | 46 | $p = new TestPublisher(); |
47 | 47 | |
48 | - $this->object->update($p, 'test'); |
|
48 | + $this->object->update( $p, 'test' ); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function update( \Aimeos\MW\Observer\Publisher\Iface $p, $action, $value = null ) |
60 | 60 | { |
61 | - if ($action == 'test') { |
|
61 | + if( $action == 'test' ) { |
|
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | } |
@@ -52,19 +52,19 @@ |
||
52 | 52 | |
53 | 53 | public function testSetId() |
54 | 54 | { |
55 | - $this->object->setId(null); |
|
55 | + $this->object->setId( null ); |
|
56 | 56 | $this->assertEquals( true, $this->object->isModified() ); |
57 | 57 | } |
58 | 58 | |
59 | 59 | public function testGetChild() |
60 | 60 | { |
61 | - $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception'); |
|
62 | - $this->object->getChild(null); |
|
61 | + $this->setExpectedException( '\\Aimeos\\MW\\Tree\\Exception' ); |
|
62 | + $this->object->getChild( null ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function testMagicGet() |
66 | 66 | { |
67 | - $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception'); |
|
67 | + $this->setExpectedException( '\\Aimeos\\MW\\Tree\\Exception' ); |
|
68 | 68 | $this->object->notDefined; |
69 | 69 | } |
70 | 70 |
@@ -266,10 +266,13 @@ |
||
266 | 266 | |
267 | 267 | $conn = $this->object->acquire(); |
268 | 268 | |
269 | - try { |
|
269 | + try |
|
270 | + { |
|
270 | 271 | $stmt = $conn->create( $sqlinsert ); |
271 | 272 | $stmt->execute(); |
272 | - } catch ( \Aimeos\MW\DB\Exception $de ) { |
|
273 | + } |
|
274 | + catch ( \Aimeos\MW\DB\Exception $de ) |
|
275 | + { |
|
273 | 276 | $this->object->release( $conn ); |
274 | 277 | return; |
275 | 278 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $conn = $this->object->acquire(); |
216 | 216 | |
217 | 217 | $value = "(\\')"; |
218 | - $sqlinsert = str_replace( ':value', '\'' . $conn->escape( $value ) . '\'', $sqlinsert ); |
|
218 | + $sqlinsert = str_replace( ':value', '\''.$conn->escape( $value ).'\'', $sqlinsert ); |
|
219 | 219 | $stmt = $conn->create( $sqlinsert ); |
220 | 220 | $stmt->execute()->finish(); |
221 | 221 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | $conn = $this->object->acquire(); |
231 | 231 | |
232 | - $sqlinsert = 'INSERT INTO "mw_unit_test" ("name") VALUES (\'' . $conn->escape( '\'\'' ) . '\')'; |
|
232 | + $sqlinsert = 'INSERT INTO "mw_unit_test" ("name") VALUES (\''.$conn->escape( '\'\'' ).'\')'; |
|
233 | 233 | |
234 | 234 | $stmt = $conn->create( $sqlinsert ); |
235 | 235 | $stmt->execute()->finish(); |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | |
257 | 257 | public function testStmtSimpleInvalidBindParamType() |
258 | 258 | { |
259 | - $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
259 | + $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
260 | 260 | |
261 | 261 | $conn = $this->object->acquire(); |
262 | 262 | |
263 | 263 | try |
264 | 264 | { |
265 | 265 | $stmt2 = $conn->create( $sqlinsert2 ); |
266 | - $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
267 | - $stmt2->bind( 2, 0.15, 123); |
|
266 | + $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
267 | + $stmt2->bind( 2, 0.15, 123 ); |
|
268 | 268 | $stmt2->execute(); |
269 | 269 | } |
270 | 270 | catch( \Aimeos\MW\DB\Exception $de ) |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | $this->object->release( $conn ); |
277 | - $this->fail('An expected exception has not been raised'); |
|
277 | + $this->fail( 'An expected exception has not been raised' ); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | |
@@ -287,13 +287,13 @@ discard block |
||
287 | 287 | try { |
288 | 288 | $stmt = $conn->create( $sqlinsert ); |
289 | 289 | $stmt->execute(); |
290 | - } catch ( \Aimeos\MW\DB\Exception $de ) { |
|
290 | + } catch( \Aimeos\MW\DB\Exception $de ) { |
|
291 | 291 | $this->object->release( $conn ); |
292 | 292 | return; |
293 | 293 | } |
294 | 294 | |
295 | 295 | $this->object->release( $conn ); |
296 | - $this->fail('An expected exception has not been raised'); |
|
296 | + $this->fail( 'An expected exception has not been raised' ); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | public function testWrongFieldType() |
342 | 342 | { |
343 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
343 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
344 | 344 | $sqlinsert = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
345 | 345 | |
346 | 346 | $conn = $this->object->acquire(); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $stmt->bind( 2, 'test', 123 ); |
353 | 353 | $stmt->execute(); |
354 | 354 | } |
355 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
355 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
356 | 356 | { |
357 | 357 | $this->object->release( $conn ); |
358 | 358 | throw $e; |
@@ -376,13 +376,13 @@ discard block |
||
376 | 376 | |
377 | 377 | $conn = $this->object->acquire(); |
378 | 378 | |
379 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
379 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
380 | 380 | |
381 | 381 | try |
382 | 382 | { |
383 | 383 | $conn->create( $sql )->execute()->finish(); |
384 | 384 | } |
385 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
385 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
386 | 386 | { |
387 | 387 | $this->object->release( $conn ); |
388 | 388 | throw $e; |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | { |
395 | 395 | $conn = $this->object->acquire(); |
396 | 396 | |
397 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
397 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
398 | 398 | |
399 | 399 | try |
400 | 400 | { |
401 | 401 | $conn->create( 'SELECT *' )->execute()->finish(); |
402 | 402 | } |
403 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
403 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
404 | 404 | { |
405 | 405 | $this->object->release( $conn ); |
406 | 406 | throw $e; |
@@ -414,13 +414,13 @@ discard block |
||
414 | 414 | |
415 | 415 | $conn = $this->object->acquire(); |
416 | 416 | |
417 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
417 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
418 | 418 | |
419 | 419 | try |
420 | 420 | { |
421 | 421 | $conn->create( $sql, 123 ); |
422 | 422 | } |
423 | - catch (\Aimeos\MW\DB\Exception $e) |
|
423 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
424 | 424 | { |
425 | 425 | $this->object->release( $conn ); |
426 | 426 | throw $e; |
@@ -432,20 +432,20 @@ discard block |
||
432 | 432 | { |
433 | 433 | $mock = $this->getMockBuilder( '\Aimeos\MW\DB\Connection\Iface' )->getMock(); |
434 | 434 | |
435 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
435 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
436 | 436 | $this->object->release( $mock ); |
437 | 437 | } |
438 | 438 | |
439 | 439 | |
440 | 440 | public function testDBFactory() |
441 | 441 | { |
442 | - $this->assertInstanceOf('\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object); |
|
442 | + $this->assertInstanceOf( '\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object ); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | |
446 | 446 | public function testFactoryFail() |
447 | 447 | { |
448 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
448 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
449 | 449 | \Aimeos\MW\DB\Factory::createManager( \TestHelperMw::getConfig(), 'notDefined' ); |
450 | 450 | } |
451 | 451 | } |