Passed
Pull Request — master (#198)
by Daniel
05:34
created
ext_tables.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-defined('TYPO3') or die();
3
+defined( 'TYPO3' ) or die();
4 4
 
5 5
 
6
-$aimeosExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('aimeos');
6
+$aimeosExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath( 'aimeos' );
7 7
 
8
-if (file_exists($aimeosExtPath . '/Resources/Libraries/autoload.php') === true) {
8
+if( file_exists( $aimeosExtPath . '/Resources/Libraries/autoload.php' ) === true ) {
9 9
     require_once $aimeosExtPath . '/Resources/Libraries/autoload.php';
10 10
 }
11 11
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * Register Aimeos icon
15 15
  */
16 16
 
17
-$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
17
+$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Imaging\IconRegistry::class );
18 18
 $iconRegistry->registerIcon(
19 19
     'aimeos-shop',
20 20
     \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
     'labels' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf',
33 33
 ];
34 34
 
35
-if ((bool) \Aimeos\Aimeos\Base::getExtConfig('showPageTree', false) == false) {
35
+if( (bool) \Aimeos\Aimeos\Base::getExtConfig( 'showPageTree', false ) == false ) {
36 36
     $_aimeosConfiguration['navigationComponentId'] = null;
37 37
     $_aimeosConfiguration['inheritNavigationComponentFromMainModule'] = false;
38 38
 }
39 39
 
40
-$name = defined('TYPO3_version') && version_compare(constant('TYPO3_version'), '11.0.0', '<') ? 'Aimeos.' : '';
40
+$name = defined( 'TYPO3_version' ) && version_compare( constant( 'TYPO3_version' ), '11.0.0', '<' ) ? 'Aimeos.' : '';
41 41
 
42 42
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
43 43
     $name . 'aimeos',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 );
55 55
 
56 56
 
57
-$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
57
+$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 'TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher' );
58 58
 
59 59
 /**
60 60
  * Execute the setup tasks automatically to create the required tables
Please login to merge, or discard this patch.
class.ext_update.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
15 15
 
16 16
 
17
-if (file_exists(__DIR__ . '/Resources/Libraries/autoload.php') === true) {
17
+if( file_exists( __DIR__ . '/Resources/Libraries/autoload.php' ) === true ) {
18 18
     require_once __DIR__ . '/Resources/Libraries/autoload.php';
19 19
 }
20 20
 
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
     public function main()
46 46
     {
47 47
         ob_start();
48
-        $exectimeStart = microtime(true);
48
+        $exectimeStart = microtime( true );
49 49
 
50
-        if (($result = $this->checkEnvironment()) !== null) {
50
+        if( ( $result = $this->checkEnvironment() ) !== null ) {
51 51
             return $result;
52 52
         }
53 53
 
54 54
         try {
55 55
             \Aimeos\Aimeos\Setup::execute();
56 56
             $output = ob_get_contents();
57
-        } catch(Exception $e) {
57
+        } catch( Exception $e ) {
58 58
             $output = ob_get_contents();
59 59
             $output .= PHP_EOL . $e->getMessage();
60 60
             $output .= PHP_EOL . $e->getTraceAsString();
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
         return '<pre>' . $output . '</pre>' . PHP_EOL .
67
-            sprintf("Setup process lasted %1\$f sec</br>\n", (microtime(true) - $exectimeStart));
67
+            sprintf( "Setup process lasted %1\$f sec</br>\n", ( microtime( true ) - $exectimeStart ) );
68 68
     }
69 69
 
70 70
 
@@ -77,53 +77,53 @@  discard block
 block discarded – undo
77 77
      */
78 78
     protected function checkEnvironment()
79 79
     {
80
-        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
81
-        $connectionPool = $objectManager->get(TYPO3\CMS\Core\Database\ConnectionPool::class);
82
-        $connection = $connectionPool->getQueryBuilderForTable('fe_user')->getConnection();
80
+        $objectManager = GeneralUtility::makeInstance( ObjectManager::class );
81
+        $connectionPool = $objectManager->get( TYPO3\CMS\Core\Database\ConnectionPool::class );
82
+        $connection = $connectionPool->getQueryBuilderForTable( 'fe_user' )->getConnection();
83 83
         $params = $connection->getParams();
84 84
 
85
-        if (strpos($connection->getServerVersion(), 'MySQL') === false) {
85
+        if( strpos( $connection->getServerVersion(), 'MySQL' ) === false ) {
86 86
             return;
87 87
         }
88 88
 
89 89
         // MariaDB might get identified as a 'MySQL 5.5.5' for some reason
90
-        $result = $connection->prepare('SELECT version()');
90
+        $result = $connection->prepare( 'SELECT version()' );
91 91
         $result->execute();
92 92
         $rows = $result->fetchAll();
93 93
 
94
-        if (!isset($rows[0]['version()'])) {
94
+        if( !isset( $rows[0]['version()'] ) ) {
95 95
             return;
96 96
         }
97 97
 
98 98
         $version = $rows[0]['version()']; // Something like '10.1.29-MariaDB' or '5.6.33-0ubuntu0'
99 99
 
100 100
         // Only MySQL < 5.7 and MariaDB < 10.2 don't work
101
-        if ((strpos($version, 'MariaDB') !== false && version_compare($version, '10.2', '>='))
102
-            || version_compare($version, '5.7', '>=')
101
+        if( ( strpos( $version, 'MariaDB' ) !== false && version_compare( $version, '10.2', '>=' ) )
102
+            || version_compare( $version, '5.7', '>=' )
103 103
         ) {
104 104
             return;
105 105
         }
106 106
 
107 107
         // MySQL < 5.7 and utf8mb4 charset doesn't work due to missing long index support
108
-        if (isset($params['tableoptions']['charset']) && $params['tableoptions']['charset'] !== 'utf8mb4') {
108
+        if( isset( $params['tableoptions']['charset'] ) && $params['tableoptions']['charset'] !== 'utf8mb4' ) {
109 109
             return;
110 110
         }
111 111
 
112 112
         // Retrieve the name of the connection (which is not part of the connection class)
113
-        foreach($connectionPool->getConnectionNames() as $name) {
114
-            if ($connectionPool->getConnectionByName($name) === $connection) {
113
+        foreach( $connectionPool->getConnectionNames() as $name ) {
114
+            if( $connectionPool->getConnectionByName( $name ) === $connection ) {
115 115
                 break;
116 116
             }
117 117
         }
118 118
 
119 119
         $msg = $objectManager->get(
120 120
             FlashMessage::class,
121
-            LocalizationUtility::translate('LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_text', 'aimeos', [$name]),
122
-            LocalizationUtility::translate('LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_header'),
121
+            LocalizationUtility::translate( 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_text', 'aimeos', [$name] ),
122
+            LocalizationUtility::translate( 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_header' ),
123 123
             FlashMessage::ERROR
124 124
         );
125 125
 
126
-        return $objectManager->get(FlashMessageRendererResolver::class)->resolve()->render([$msg]) .
127
-            LocalizationUtility::translate('LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_remedy');
126
+        return $objectManager->get( FlashMessageRendererResolver::class )->resolve()->render( [$msg] ) .
127
+            LocalizationUtility::translate( 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:t3_9x_config_error_remedy' );
128 128
     }
129 129
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,10 +51,13 @@
 block discarded – undo
51 51
             return $result;
52 52
         }
53 53
 
54
-        try {
54
+        try
55
+        {
55 56
             \Aimeos\Aimeos\Setup::execute();
56 57
             $output = ob_get_contents();
57
-        } catch(Exception $e) {
58
+        }
59
+        catch(Exception $e)
60
+        {
58 61
             $output = ob_get_contents();
59 62
             $output .= PHP_EOL . $e->getMessage();
60 63
             $output .= PHP_EOL . $e->getTraceAsString();
Please login to merge, or discard this patch.
Tests/Unit/Flexform/CatalogTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function tearDown()
20 20
     {
21
-        unset($this->object);
21
+        unset( $this->object );
22 22
     }
23 23
 
24 24
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function getCategories()
29 29
     {
30
-        $result = $this->object->getCategories(array('items' => []));
30
+        $result = $this->object->getCategories( array( 'items' => [] ) );
31 31
 
32
-        $this->assertArrayHasKey('items', $result);
32
+        $this->assertArrayHasKey( 'items', $result );
33 33
     }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
Tests/Unit/Scheduler/Task/Email6Test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function tearDown()
20 20
     {
21
-        unset($this->object);
21
+        unset( $this->object );
22 22
     }
23 23
 
24 24
 
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $result = $this->object->execute();
31 31
 
32
-        $this->assertTrue($result);
32
+        $this->assertTrue( $result );
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
Tests/Unit/Scheduler/Provider/Email6Test.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function tearDown()
24 24
     {
25
-        unset($this->object);
25
+        unset( $this->object );
26 26
     }
27 27
 
28 28
 
@@ -34,15 +34,15 @@  discard block
 block discarded – undo
34 34
         $taskInfo = [];
35 35
         $module = new SchedulerModuleController();
36 36
 
37
-        $result = $this->object->getAdditionalFields($taskInfo, $this->object, $module);
37
+        $result = $this->object->getAdditionalFields( $taskInfo, $this->object, $module );
38 38
 
39
-        $this->assertInternalType('array', $result);
40
-        $this->assertArrayHasKey('aimeos_controller', $result);
41
-        $this->assertArrayHasKey('aimeos_sitecode', $result);
42
-        $this->assertArrayHasKey('aimeos_config', $result);
43
-        $this->assertArrayHasKey('aimeos_sender_from', $result);
44
-        $this->assertArrayHasKey('aimeos_sender_email', $result);
45
-        $this->assertArrayHasKey('aimeos_reply_email', $result);
39
+        $this->assertInternalType( 'array', $result );
40
+        $this->assertArrayHasKey( 'aimeos_controller', $result );
41
+        $this->assertArrayHasKey( 'aimeos_sitecode', $result );
42
+        $this->assertArrayHasKey( 'aimeos_config', $result );
43
+        $this->assertArrayHasKey( 'aimeos_sender_from', $result );
44
+        $this->assertArrayHasKey( 'aimeos_sender_email', $result );
45
+        $this->assertArrayHasKey( 'aimeos_reply_email', $result );
46 46
     }
47 47
 
48 48
 
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $taskInfo = [];
55 55
         $module = new SchedulerModuleController();
56
-        $module->setCurrentAction(new Action('EDIT'));
56
+        $module->setCurrentAction( new Action( 'EDIT' ) );
57 57
 
58
-        $mock = $this->getMockBuilder('\Aimeos\Aimeos\Scheduler\Provider\Email6')
59
-            ->setMethods(['getFields'])->getMock();
58
+        $mock = $this->getMockBuilder( '\Aimeos\Aimeos\Scheduler\Provider\Email6' )
59
+            ->setMethods( ['getFields'] )->getMock();
60 60
 
61
-        $mock->expects($this->once())->method('getFields')
62
-            ->will($this->throwException(new \RuntimeException()));
61
+        $mock->expects( $this->once() )->method( 'getFields' )
62
+            ->will( $this->throwException( new \RuntimeException() ) );
63 63
 
64
-        $result = $mock->getAdditionalFields($taskInfo, $mock, $module);
64
+        $result = $mock->getAdditionalFields( $taskInfo, $mock, $module );
65 65
 
66
-        $this->assertEquals([], $result);
66
+        $this->assertEquals( [], $result );
67 67
     }
68 68
 
69 69
 
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
         ];
83 83
         $task = new Scheduler\Task\Typo6();
84 84
 
85
-        $this->object->saveAdditionalFields($data, $task);
85
+        $this->object->saveAdditionalFields( $data, $task );
86 86
 
87
-        $this->assertEquals('testsite', $task->aimeos_sitecode);
88
-        $this->assertEquals('testcntl', $task->aimeos_controller);
89
-        $this->assertEquals('testconf', $task->aimeos_config);
90
-        $this->assertEquals('test name', $task->aimeos_sender_from);
91
-        $this->assertEquals('sender@test', $task->aimeos_sender_email);
92
-        $this->assertEquals('reply@test', $task->aimeos_reply_email);
87
+        $this->assertEquals( 'testsite', $task->aimeos_sitecode );
88
+        $this->assertEquals( 'testcntl', $task->aimeos_controller );
89
+        $this->assertEquals( 'testconf', $task->aimeos_config );
90
+        $this->assertEquals( 'test name', $task->aimeos_sender_from );
91
+        $this->assertEquals( 'sender@test', $task->aimeos_sender_email );
92
+        $this->assertEquals( 'reply@test', $task->aimeos_reply_email );
93 93
     }
94 94
 
95 95
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $data = [];
102 102
         $module = new SchedulerModuleController();
103 103
 
104
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
104
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
105 105
     }
106 106
 
107 107
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         ];
116 116
         $module = new SchedulerModuleController();
117 117
 
118
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
118
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
119 119
     }
120 120
 
121 121
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         ];
133 133
         $module = new SchedulerModuleController();
134 134
 
135
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
135
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
136 136
     }
137 137
 
138 138
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         ];
149 149
         $module = new SchedulerModuleController();
150 150
 
151
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
151
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
152 152
     }
153 153
 
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         ];
166 166
         $module = new SchedulerModuleController();
167 167
 
168
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
168
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
169 169
     }
170 170
 
171 171
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         ];
184 184
         $module = new SchedulerModuleController();
185 185
 
186
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
186
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
187 187
     }
188 188
 
189 189
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         ];
201 201
         $module = new SchedulerModuleController();
202 202
 
203
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
203
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
204 204
     }
205 205
 
206 206
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         ];
219 219
         $module = new SchedulerModuleController();
220 220
 
221
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
221
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
222 222
     }
223 223
 
224 224
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         ];
236 236
         $module = new SchedulerModuleController();
237 237
 
238
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
238
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
239 239
     }
240 240
 
241 241
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         ];
253 253
         $module = new SchedulerModuleController();
254 254
 
255
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
255
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
256 256
     }
257 257
 
258 258
 
@@ -273,6 +273,6 @@  discard block
 block discarded – undo
273 273
         ];
274 274
         $module = new SchedulerModuleController();
275 275
 
276
-        $this->assertTrue($this->object->validateAdditionalFields($data, $module));
276
+        $this->assertTrue( $this->object->validateAdditionalFields( $data, $module ) );
277 277
     }
278 278
 }
Please login to merge, or discard this patch.
Tests/Unit/Scheduler/Provider/Typo6Test.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function tearDown()
23 23
     {
24
-        unset($this->object);
24
+        unset( $this->object );
25 25
     }
26 26
 
27 27
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $taskInfo = [];
34 34
         $module = new SchedulerModuleController();
35
-        $module->setCurrentAction(new Action('EDIT'));
35
+        $module->setCurrentAction( new Action( 'EDIT' ) );
36 36
 
37
-        $result = $this->object->getAdditionalFields($taskInfo, $this->object, $module);
37
+        $result = $this->object->getAdditionalFields( $taskInfo, $this->object, $module );
38 38
 
39
-        $this->assertInternalType('array', $result);
40
-        $this->assertArrayHasKey('aimeos_controller', $result);
41
-        $this->assertArrayHasKey('aimeos_sitecode', $result);
42
-        $this->assertArrayHasKey('aimeos_config', $result);
39
+        $this->assertInternalType( 'array', $result );
40
+        $this->assertArrayHasKey( 'aimeos_controller', $result );
41
+        $this->assertArrayHasKey( 'aimeos_sitecode', $result );
42
+        $this->assertArrayHasKey( 'aimeos_config', $result );
43 43
     }
44 44
 
45 45
 
@@ -50,17 +50,17 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $taskInfo = [];
52 52
         $module = new SchedulerModuleController();
53
-        $module->setCurrentAction(new Action('EDIT'));
53
+        $module->setCurrentAction( new Action( 'EDIT' ) );
54 54
 
55
-        $mock = $this->getMockBuilder('\Aimeos\Aimeos\Scheduler\Provider\Typo6')
56
-            ->setMethods(['getFields'])->getMock();
55
+        $mock = $this->getMockBuilder( '\Aimeos\Aimeos\Scheduler\Provider\Typo6' )
56
+            ->setMethods( ['getFields'] )->getMock();
57 57
 
58
-        $mock->expects($this->once())->method('getFields')
59
-            ->will($this->throwException(new \RuntimeException()));
58
+        $mock->expects( $this->once() )->method( 'getFields' )
59
+            ->will( $this->throwException( new \RuntimeException() ) );
60 60
 
61
-        $result = $mock->getAdditionalFields($taskInfo, $mock, $module);
61
+        $result = $mock->getAdditionalFields( $taskInfo, $mock, $module );
62 62
 
63
-        $this->assertEquals([], $result);
63
+        $this->assertEquals( [], $result );
64 64
     }
65 65
 
66 66
 
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
         ];
77 77
         $task = new \Aimeos\Aimeos\Scheduler\Task\Typo6();
78 78
 
79
-        $this->object->saveAdditionalFields($data, $task);
79
+        $this->object->saveAdditionalFields( $data, $task );
80 80
 
81
-        $this->assertEquals('testsite', $task->aimeos_sitecode);
82
-        $this->assertEquals('testcntl', $task->aimeos_controller);
83
-        $this->assertEquals('testconf', $task->aimeos_config);
81
+        $this->assertEquals( 'testsite', $task->aimeos_sitecode );
82
+        $this->assertEquals( 'testcntl', $task->aimeos_controller );
83
+        $this->assertEquals( 'testconf', $task->aimeos_config );
84 84
     }
85 85
 
86 86
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $data = [];
93 93
         $module = new SchedulerModuleController();
94 94
 
95
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
95
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
96 96
     }
97 97
 
98 98
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         ];
107 107
         $module = new SchedulerModuleController();
108 108
 
109
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
109
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
110 110
     }
111 111
 
112 112
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         ];
123 123
         $module = new SchedulerModuleController();
124 124
 
125
-        $this->assertFalse($this->object->validateAdditionalFields($data, $module));
125
+        $this->assertFalse( $this->object->validateAdditionalFields( $data, $module ) );
126 126
     }
127 127
 
128 128
 
@@ -137,6 +137,6 @@  discard block
 block discarded – undo
137 137
         ];
138 138
         $module = new SchedulerModuleController();
139 139
 
140
-        $this->assertTrue($this->object->validateAdditionalFields($data, $module));
140
+        $this->assertTrue( $this->object->validateAdditionalFields( $data, $module ) );
141 141
     }
142 142
 }
Please login to merge, or discard this patch.
Tests/Unit/Controller/JqadmControllerTest.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -16,43 +16,43 @@  discard block
 block discarded – undo
16 16
     {
17 17
         \Aimeos\Aimeos\Base::aimeos(); // initialize autoloader
18 18
 
19
-        $this->object = $this->getAccessibleMock('Aimeos\Aimeos\Controller\JqadmController', array('dummy'));
19
+        $this->object = $this->getAccessibleMock( 'Aimeos\Aimeos\Controller\JqadmController', array( 'dummy' ) );
20 20
 
21
-        $this->request = $this->getMockBuilder('TYPO3\CMS\Extbase\Mvc\Request')
22
-            ->setMethods(array('hasArgument', 'getArgument'))
21
+        $this->request = $this->getMockBuilder( 'TYPO3\CMS\Extbase\Mvc\Request' )
22
+            ->setMethods( array( 'hasArgument', 'getArgument' ) )
23 23
             ->disableOriginalConstructor()
24 24
             ->getMock();
25 25
 
26
-        $this->response = $this->getMockBuilder('TYPO3\CMS\Extbase\Mvc\Response')
27
-            ->setMethods(array('setHeader'))
26
+        $this->response = $this->getMockBuilder( 'TYPO3\CMS\Extbase\Mvc\Response' )
27
+            ->setMethods( array( 'setHeader' ) )
28 28
             ->disableOriginalConstructor()
29 29
             ->getMock();
30 30
 
31
-        $this->view = $this->getMockBuilder('TYPO3\CMS\Extbase\Mvc\View\EmptyView')
32
-            ->setMethods(array('assign'))
31
+        $this->view = $this->getMockBuilder( 'TYPO3\CMS\Extbase\Mvc\View\EmptyView' )
32
+            ->setMethods( array( 'assign' ) )
33 33
             ->disableOriginalConstructor()
34 34
             ->getMock();
35 35
 
36
-        $uriBuilder = $this->getMockBuilder('TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder')
37
-            ->setMethods(array('buildBackendUri'))
36
+        $uriBuilder = $this->getMockBuilder( 'TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder' )
37
+            ->setMethods( array( 'buildBackendUri' ) )
38 38
             ->disableOriginalConstructor()
39 39
             ->getMock();
40 40
 
41 41
 
42
-        $uriBuilder->expects($this->any())->method('buildBackendUri');
42
+        $uriBuilder->expects( $this->any() )->method( 'buildBackendUri' );
43 43
 
44
-        $this->object->_set('uriBuilder', $uriBuilder);
45
-        $this->object->_set('response', $this->response);
46
-        $this->object->_set('request', $this->request);
47
-        $this->object->_set('view', $this->view);
44
+        $this->object->_set( 'uriBuilder', $uriBuilder );
45
+        $this->object->_set( 'response', $this->response );
46
+        $this->object->_set( 'request', $this->request );
47
+        $this->object->_set( 'view', $this->view );
48 48
 
49
-        $this->object->_call('initializeAction');
49
+        $this->object->_call( 'initializeAction' );
50 50
     }
51 51
 
52 52
 
53 53
     public function tearDown()
54 54
     {
55
-        unset($this->object, $this->request, $this->view);
55
+        unset( $this->object, $this->request, $this->view );
56 56
     }
57 57
 
58 58
 
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function fileActionCss()
63 63
     {
64
-        $this->request->expects($this->any())->method('getArgument')
65
-            ->will($this->returnValue('css'));
64
+        $this->request->expects( $this->any() )->method( 'getArgument' )
65
+            ->will( $this->returnValue( 'css' ) );
66 66
 
67 67
         $result = $this->object->fileAction();
68 68
 
69
-        $this->assertContains('.aimeos', $result);
69
+        $this->assertContains( '.aimeos', $result );
70 70
     }
71 71
 
72 72
 
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function fileActionJs()
77 77
     {
78
-        $this->request->expects($this->any())->method('getArgument')
79
-        ->will($this->returnValue('js'));
78
+        $this->request->expects( $this->any() )->method( 'getArgument' )
79
+        ->will( $this->returnValue( 'js' ) );
80 80
 
81 81
         $result = $this->object->fileAction();
82 82
 
83
-        $this->assertContains('Aimeos = {', $result);
83
+        $this->assertContains( 'Aimeos = {', $result );
84 84
     }
85 85
 
86 86
 
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function copyAction()
91 91
     {
92
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
93
-            ->will($this->returnValue(true));
92
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
93
+            ->will( $this->returnValue( true ) );
94 94
 
95
-        $this->request->expects($this->any())->method('getArgument')
96
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
95
+        $this->request->expects( $this->any() )->method( 'getArgument' )
96
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
97 97
 
98
-        $this->view->expects($this->exactly(2))->method('assign');
98
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
99 99
 
100 100
         $this->object->copyAction();
101 101
     }
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function createAction()
108 108
     {
109
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
110
-            ->will($this->returnValue(true));
109
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
110
+            ->will( $this->returnValue( true ) );
111 111
 
112
-        $this->request->expects($this->any())->method('getArgument')
113
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
112
+        $this->request->expects( $this->any() )->method( 'getArgument' )
113
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
114 114
 
115
-        $this->view->expects($this->exactly(2))->method('assign');
115
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
116 116
 
117 117
         $this->object->createAction();
118 118
     }
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function deleteAction()
125 125
     {
126
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
127
-            ->will($this->returnValue(true));
126
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
127
+            ->will( $this->returnValue( true ) );
128 128
 
129
-        $this->request->expects($this->any())->method('getArgument')
130
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
129
+        $this->request->expects( $this->any() )->method( 'getArgument' )
130
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
131 131
 
132
-        $this->view->expects($this->exactly(2))->method('assign');
132
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
133 133
 
134 134
         $this->object->deleteAction();
135 135
     }
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function getAction()
142 142
     {
143
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
144
-            ->will($this->returnValue(true));
143
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
144
+            ->will( $this->returnValue( true ) );
145 145
 
146
-        $this->request->expects($this->any())->method('getArgument')
147
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
146
+        $this->request->expects( $this->any() )->method( 'getArgument' )
147
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
148 148
 
149
-        $this->view->expects($this->exactly(2))->method('assign');
149
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
150 150
 
151 151
         $this->object->getAction();
152 152
     }
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function saveAction()
159 159
     {
160
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
161
-            ->will($this->returnValue(true));
160
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
161
+            ->will( $this->returnValue( true ) );
162 162
 
163
-        $this->request->expects($this->any())->method('getArgument')
164
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
163
+        $this->request->expects( $this->any() )->method( 'getArgument' )
164
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
165 165
 
166
-        $this->view->expects($this->exactly(2))->method('assign');
166
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
167 167
 
168 168
         $this->object->saveAction();
169 169
     }
@@ -174,13 +174,13 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function searchAction()
176 176
     {
177
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
178
-            ->will($this->returnValue(true));
177
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
178
+            ->will( $this->returnValue( true ) );
179 179
 
180
-        $this->request->expects($this->any())->method('getArgument')
181
-            ->will($this->onConsecutiveCalls('product', 'de', 'unittest'));
180
+        $this->request->expects( $this->any() )->method( 'getArgument' )
181
+            ->will( $this->onConsecutiveCalls( 'product', 'de', 'unittest' ) );
182 182
 
183
-        $this->view->expects($this->exactly(2))->method('assign');
183
+        $this->view->expects( $this->exactly( 2 ) )->method( 'assign' );
184 184
 
185 185
         $this->object->searchAction();
186 186
     }
Please login to merge, or discard this patch.
Tests/Unit/Controller/CatalogControllerTest.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@  discard block
 block discarded – undo
14 14
     {
15 15
         \Aimeos\Aimeos\Base::aimeos(); // initialize autoloader
16 16
 
17
-        $this->object = $this->getAccessibleMock('Aimeos\\Aimeos\\Controller\\CatalogController', array('dummy'));
17
+        $this->object = $this->getAccessibleMock( 'Aimeos\\Aimeos\\Controller\\CatalogController', array( 'dummy' ) );
18 18
 
19 19
         $objManager = new \TYPO3\CMS\Extbase\Object\ObjectManager();
20 20
 
21
-        $uriBuilder = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
22
-        $response = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
23
-        $request = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
21
+        $uriBuilder = $objManager->get( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder' );
22
+        $response = $objManager->get( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response' );
23
+        $request = $objManager->get( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request' );
24 24
 
25
-        $uriBuilder->setRequest($request);
25
+        $uriBuilder->setRequest( $request );
26 26
 
27
-        if (method_exists($response, 'setRequest')) {
28
-            $response->setRequest($request);
27
+        if( method_exists( $response, 'setRequest' ) ) {
28
+            $response->setRequest( $request );
29 29
         }
30 30
 
31
-        $this->object->_set('uriBuilder', $uriBuilder);
32
-        $this->object->_set('response', $response);
33
-        $this->object->_set('request', $request);
31
+        $this->object->_set( 'uriBuilder', $uriBuilder );
32
+        $this->object->_set( 'response', $response );
33
+        $this->object->_set( 'request', $request );
34 34
 
35
-        $this->object->_call('initializeAction');
35
+        $this->object->_call( 'initializeAction' );
36 36
     }
37 37
 
38 38
 
39 39
     public function tearDown()
40 40
     {
41
-        unset($this->object);
41
+        unset( $this->object );
42 42
     }
43 43
 
44 44
 
@@ -48,16 +48,16 @@  discard block
 block discarded – undo
48 48
     public function countAction()
49 49
     {
50 50
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Count\\Standard';
51
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
51
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
52 52
 
53
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
54
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
53
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
54
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
55 55
 
56
-        \Aimeos\Client\Html\Catalog\Count\Factory::injectClient($name, $client);
56
+        \Aimeos\Client\Html\Catalog\Count\Factory::injectClient( $name, $client );
57 57
         $output = $this->object->countAction();
58
-        \Aimeos\Client\Html\Catalog\Count\Factory::injectClient($name, null);
58
+        \Aimeos\Client\Html\Catalog\Count\Factory::injectClient( $name, null );
59 59
 
60
-        $this->assertEquals('body', $output);
60
+        $this->assertEquals( 'body', $output );
61 61
     }
62 62
 
63 63
 
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
     public function detailAction()
68 68
     {
69 69
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Detail\\Standard';
70
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
70
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
71 71
 
72
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
73
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
72
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
73
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
74 74
 
75
-        \Aimeos\Client\Html\Catalog\Detail\Factory::injectClient($name, $client);
75
+        \Aimeos\Client\Html\Catalog\Detail\Factory::injectClient( $name, $client );
76 76
         $output = $this->object->detailAction();
77
-        \Aimeos\Client\Html\Catalog\Detail\Factory::injectClient($name, null);
77
+        \Aimeos\Client\Html\Catalog\Detail\Factory::injectClient( $name, null );
78 78
 
79
-        $this->assertEquals('body', $output);
79
+        $this->assertEquals( 'body', $output );
80 80
     }
81 81
 
82 82
 
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
     public function filterAction()
87 87
     {
88 88
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Filter\\Standard';
89
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
89
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
90 90
 
91
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
92
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
91
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
92
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
93 93
 
94
-        \Aimeos\Client\Html\Catalog\Filter\Factory::injectClient($name, $client);
94
+        \Aimeos\Client\Html\Catalog\Filter\Factory::injectClient( $name, $client );
95 95
         $output = $this->object->filterAction();
96
-        \Aimeos\Client\Html\Catalog\Filter\Factory::injectClient($name, null);
96
+        \Aimeos\Client\Html\Catalog\Filter\Factory::injectClient( $name, null );
97 97
 
98
-        $this->assertEquals('body', $output);
98
+        $this->assertEquals( 'body', $output );
99 99
     }
100 100
 
101 101
 
@@ -105,16 +105,16 @@  discard block
 block discarded – undo
105 105
     public function listAction()
106 106
     {
107 107
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Lists\\Standard';
108
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
108
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
109 109
 
110
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
111
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
110
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
111
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
112 112
 
113
-        \Aimeos\Client\Html\Catalog\Lists\Factory::injectClient($name, $client);
113
+        \Aimeos\Client\Html\Catalog\Lists\Factory::injectClient( $name, $client );
114 114
         $output = $this->object->listAction();
115
-        \Aimeos\Client\Html\Catalog\Lists\Factory::injectClient($name, null);
115
+        \Aimeos\Client\Html\Catalog\Lists\Factory::injectClient( $name, null );
116 116
 
117
-        $this->assertEquals('body', $output);
117
+        $this->assertEquals( 'body', $output );
118 118
     }
119 119
 
120 120
 
@@ -124,16 +124,16 @@  discard block
 block discarded – undo
124 124
     public function suggestAction()
125 125
     {
126 126
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Suggest\\Standard';
127
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
127
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
128 128
 
129
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
130
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
129
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
130
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
131 131
 
132
-        \Aimeos\Client\Html\Catalog\Suggest\Factory::injectClient($name, $client);
132
+        \Aimeos\Client\Html\Catalog\Suggest\Factory::injectClient( $name, $client );
133 133
         $output = $this->object->suggestAction();
134
-        \Aimeos\Client\Html\Catalog\Suggest\Factory::injectClient($name, null);
134
+        \Aimeos\Client\Html\Catalog\Suggest\Factory::injectClient( $name, null );
135 135
 
136
-        $this->assertEquals('body', $output);
136
+        $this->assertEquals( 'body', $output );
137 137
     }
138 138
 
139 139
 
@@ -143,16 +143,16 @@  discard block
 block discarded – undo
143 143
     public function sessionAction()
144 144
     {
145 145
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Session\\Standard';
146
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
146
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
147 147
 
148
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
149
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
148
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
149
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
150 150
 
151
-        \Aimeos\Client\Html\Catalog\Session\Factory::injectClient($name, $client);
151
+        \Aimeos\Client\Html\Catalog\Session\Factory::injectClient( $name, $client );
152 152
         $output = $this->object->sessionAction();
153
-        \Aimeos\Client\Html\Catalog\Session\Factory::injectClient($name, null);
153
+        \Aimeos\Client\Html\Catalog\Session\Factory::injectClient( $name, null );
154 154
 
155
-        $this->assertEquals('body', $output);
155
+        $this->assertEquals( 'body', $output );
156 156
     }
157 157
 
158 158
 
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
     public function stageAction()
163 163
     {
164 164
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Stage\\Standard';
165
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
165
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
166 166
 
167
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
168
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
167
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
168
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
169 169
 
170
-        \Aimeos\Client\Html\Catalog\Stage\Factory::injectClient($name, $client);
170
+        \Aimeos\Client\Html\Catalog\Stage\Factory::injectClient( $name, $client );
171 171
         $output = $this->object->stageAction();
172
-        \Aimeos\Client\Html\Catalog\Stage\Factory::injectClient($name, null);
172
+        \Aimeos\Client\Html\Catalog\Stage\Factory::injectClient( $name, null );
173 173
 
174
-        $this->assertEquals('body', $output);
174
+        $this->assertEquals( 'body', $output );
175 175
     }
176 176
 
177 177
 
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
     public function stockAction()
182 182
     {
183 183
         $name = '\\Aimeos\\Client\\Html\\Catalog\\Stock\\Standard';
184
-        $client = $this->getMock($name, array('getBody', 'getHeader', 'process'), [], '', false);
184
+        $client = $this->getMock( $name, array( 'getBody', 'getHeader', 'process' ), [], '', false );
185 185
 
186
-        $client->expects($this->once())->method('getBody')->will($this->returnValue('body'));
187
-        $client->expects($this->once())->method('getHeader')->will($this->returnValue('header'));
186
+        $client->expects( $this->once() )->method( 'getBody' )->will( $this->returnValue( 'body' ) );
187
+        $client->expects( $this->once() )->method( 'getHeader' )->will( $this->returnValue( 'header' ) );
188 188
 
189
-        \Aimeos\Client\Html\Catalog\Stock\Factory::injectClient($name, $client);
189
+        \Aimeos\Client\Html\Catalog\Stock\Factory::injectClient( $name, $client );
190 190
         $output = $this->object->stockAction();
191
-        \Aimeos\Client\Html\Catalog\Stock\Factory::injectClient($name, null);
191
+        \Aimeos\Client\Html\Catalog\Stock\Factory::injectClient( $name, null );
192 192
 
193
-        $this->assertEquals('body', $output);
193
+        $this->assertEquals( 'body', $output );
194 194
     }
195 195
 }
196 196
\ No newline at end of file
Please login to merge, or discard this patch.
Tests/Unit/Controller/JsonadmControllerTest.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -14,38 +14,38 @@  discard block
 block discarded – undo
14 14
     {
15 15
         \Aimeos\Aimeos\Base::aimeos(); // initialize autoloader
16 16
 
17
-        $this->object = $this->getAccessibleMock('Aimeos\\Aimeos\\Controller\\JsonadmController', array('dummy'));
17
+        $this->object = $this->getAccessibleMock( 'Aimeos\\Aimeos\\Controller\\JsonadmController', array( 'dummy' ) );
18 18
 
19
-        $this->request = $this->getMockBuilder('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request')
20
-            ->setMethods(array('hasArgument', 'getArgument', 'getMethod'))
19
+        $this->request = $this->getMockBuilder( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request' )
20
+            ->setMethods( array( 'hasArgument', 'getArgument', 'getMethod' ) )
21 21
             ->disableOriginalConstructor()
22 22
             ->getMock();
23 23
 
24
-        $this->response = $this->getMockBuilder('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response')
25
-            ->setMethods(array('setStatus'))
24
+        $this->response = $this->getMockBuilder( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response' )
25
+            ->setMethods( array( 'setStatus' ) )
26 26
             ->disableOriginalConstructor()
27 27
             ->getMock();
28 28
 
29 29
         $objManager = new \TYPO3\CMS\Extbase\Object\ObjectManager();
30
-        $uriBuilder = $objManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
30
+        $uriBuilder = $objManager->get( 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder' );
31 31
 
32
-        $uriBuilder->setRequest($this->request);
32
+        $uriBuilder->setRequest( $this->request );
33 33
 
34
-        if (method_exists($response, 'setRequest')) {
35
-            $response->setRequest($this->request);
34
+        if( method_exists( $response, 'setRequest' ) ) {
35
+            $response->setRequest( $this->request );
36 36
         }
37 37
 
38
-        $this->object->_set('uriBuilder', $uriBuilder);
39
-        $this->object->_set('response', $this->response);
40
-        $this->object->_set('request', $this->request);
38
+        $this->object->_set( 'uriBuilder', $uriBuilder );
39
+        $this->object->_set( 'response', $this->response );
40
+        $this->object->_set( 'request', $this->request );
41 41
 
42
-        $this->object->_call('initializeAction');
42
+        $this->object->_call( 'initializeAction' );
43 43
     }
44 44
 
45 45
 
46 46
     public function tearDown()
47 47
     {
48
-        unset($this->object, $this->request, $this->response);
48
+        unset( $this->object, $this->request, $this->response );
49 49
     }
50 50
 
51 51
 
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getAction()
56 56
     {
57
-        $this->request->expects($this->exactly(1))->method('getMethod')
58
-            ->will($this->returnValue('GET'));
57
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
58
+            ->will( $this->returnValue( 'GET' ) );
59 59
 
60
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
61
-            ->will($this->returnValue(true));
60
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
61
+            ->will( $this->returnValue( true ) );
62 62
 
63
-        $this->request->expects($this->any())->method('getArgument')
64
-            ->will($this->onConsecutiveCalls('stock/type', null, 'unittest', null, null, 'unittest', null));
63
+        $this->request->expects( $this->any() )->method( 'getArgument' )
64
+            ->will( $this->onConsecutiveCalls( 'stock/type', null, 'unittest', null, null, 'unittest', null ) );
65 65
 
66
-        $this->response->expects($this->exactly(1))->method('setStatus')
67
-            ->with($this->equalTo(200));
66
+        $this->response->expects( $this->exactly( 1 ) )->method( 'setStatus' )
67
+            ->with( $this->equalTo( 200 ) );
68 68
 
69 69
         $result = $this->object->indexAction();
70
-        $json = json_decode($result, true);
70
+        $json = json_decode( $result, true );
71 71
 
72
-        $this->assertNotEquals(null, $json);
72
+        $this->assertNotEquals( null, $json );
73 73
     }
74 74
 
75 75
 
@@ -78,26 +78,26 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function optionsAction()
80 80
     {
81
-        $this->request->expects($this->exactly(1))->method('getMethod')
82
-            ->will($this->returnValue('OPTIONS'));
81
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
82
+            ->will( $this->returnValue( 'OPTIONS' ) );
83 83
 
84
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
85
-            ->will($this->returnValue(true));
84
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
85
+            ->will( $this->returnValue( true ) );
86 86
 
87
-        $this->request->expects($this->any())->method('getArgument')
88
-            ->will($this->onConsecutiveCalls(null, null, 'unittest', null, null, 'unittest', null));
87
+        $this->request->expects( $this->any() )->method( 'getArgument' )
88
+            ->will( $this->onConsecutiveCalls( null, null, 'unittest', null, null, 'unittest', null ) );
89 89
 
90
-        $this->response->expects($this->exactly(1))->method('setStatus')
91
-            ->with($this->equalTo(200));
90
+        $this->response->expects( $this->exactly( 1 ) )->method( 'setStatus' )
91
+            ->with( $this->equalTo( 200 ) );
92 92
 
93 93
         $result = $this->object->indexAction();
94
-        $json = json_decode($result, true);
94
+        $json = json_decode( $result, true );
95 95
 
96
-        $this->assertNotEquals(null, $json);
97
-        $this->assertArrayHasKey('meta', $json);
98
-        $this->assertArrayHasKey('resources', $json['meta']);
99
-        $this->assertGreaterThan(1, count($json['meta']['resources']));
100
-        $this->assertArrayHasKey('stock/type', $json['meta']['resources']);
96
+        $this->assertNotEquals( null, $json );
97
+        $this->assertArrayHasKey( 'meta', $json );
98
+        $this->assertArrayHasKey( 'resources', $json['meta'] );
99
+        $this->assertGreaterThan( 1, count( $json['meta']['resources'] ) );
100
+        $this->assertArrayHasKey( 'stock/type', $json['meta']['resources'] );
101 101
     }
102 102
 
103 103
 
@@ -106,19 +106,19 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function deleteAction()
108 108
     {
109
-        $this->request->expects($this->exactly(1))->method('getMethod')
110
-            ->will($this->returnValue('DELETE'));
109
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
110
+            ->will( $this->returnValue( 'DELETE' ) );
111 111
 
112
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
113
-            ->will($this->returnValue(true));
112
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
113
+            ->will( $this->returnValue( true ) );
114 114
 
115
-        $this->request->expects($this->any())->method('getArgument')
116
-            ->will($this->onConsecutiveCalls('stock/type', null, 'unittest', null, null, 'unittest', null));
115
+        $this->request->expects( $this->any() )->method( 'getArgument' )
116
+            ->will( $this->onConsecutiveCalls( 'stock/type', null, 'unittest', null, null, 'unittest', null ) );
117 117
 
118 118
         $result = $this->object->indexAction();
119
-        $json = json_decode($result, true);
119
+        $json = json_decode( $result, true );
120 120
 
121
-        $this->assertNotEquals(null, $json);
121
+        $this->assertNotEquals( null, $json );
122 122
     }
123 123
 
124 124
 
@@ -127,19 +127,19 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function patchAction()
129 129
     {
130
-        $this->request->expects($this->exactly(1))->method('getMethod')
131
-            ->will($this->returnValue('PATCH'));
130
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
131
+            ->will( $this->returnValue( 'PATCH' ) );
132 132
 
133
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
134
-            ->will($this->returnValue(true));
133
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
134
+            ->will( $this->returnValue( true ) );
135 135
 
136
-        $this->request->expects($this->any())->method('getArgument')
137
-            ->will($this->onConsecutiveCalls('stock/type', null, 'unittest', null, null, 'unittest', null));
136
+        $this->request->expects( $this->any() )->method( 'getArgument' )
137
+            ->will( $this->onConsecutiveCalls( 'stock/type', null, 'unittest', null, null, 'unittest', null ) );
138 138
 
139 139
         $result = $this->object->indexAction();
140
-        $json = json_decode($result, true);
140
+        $json = json_decode( $result, true );
141 141
 
142
-        $this->assertNotEquals(null, $json);
142
+        $this->assertNotEquals( null, $json );
143 143
     }
144 144
 
145 145
 
@@ -148,19 +148,19 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function postAction()
150 150
     {
151
-        $this->request->expects($this->exactly(1))->method('getMethod')
152
-            ->will($this->returnValue('POST'));
151
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
152
+            ->will( $this->returnValue( 'POST' ) );
153 153
 
154
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
155
-            ->will($this->returnValue(true));
154
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
155
+            ->will( $this->returnValue( true ) );
156 156
 
157
-        $this->request->expects($this->any())->method('getArgument')
158
-            ->will($this->onConsecutiveCalls('stock/type', null, 'unittest', null, null, 'unittest', null));
157
+        $this->request->expects( $this->any() )->method( 'getArgument' )
158
+            ->will( $this->onConsecutiveCalls( 'stock/type', null, 'unittest', null, null, 'unittest', null ) );
159 159
 
160 160
         $result = $this->object->indexAction();
161
-        $json = json_decode($result, true);
161
+        $json = json_decode( $result, true );
162 162
 
163
-        $this->assertNotEquals(null, $json);
163
+        $this->assertNotEquals( null, $json );
164 164
     }
165 165
 
166 166
 
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
      */
170 170
     public function putAction()
171 171
     {
172
-        $this->request->expects($this->exactly(1))->method('getMethod')
173
-            ->will($this->returnValue('PUT'));
172
+        $this->request->expects( $this->exactly( 1 ) )->method( 'getMethod' )
173
+            ->will( $this->returnValue( 'PUT' ) );
174 174
 
175
-        $this->request->expects($this->atLeastOnce())->method('hasArgument')
176
-            ->will($this->returnValue(true));
175
+        $this->request->expects( $this->atLeastOnce() )->method( 'hasArgument' )
176
+            ->will( $this->returnValue( true ) );
177 177
 
178
-        $this->request->expects($this->any())->method('getArgument')
179
-            ->will($this->onConsecutiveCalls('stock/type', null, 'unittest', null, null, 'unittest', null));
178
+        $this->request->expects( $this->any() )->method( 'getArgument' )
179
+            ->will( $this->onConsecutiveCalls( 'stock/type', null, 'unittest', null, null, 'unittest', null ) );
180 180
 
181 181
         $result = $this->object->indexAction();
182
-        $json = json_decode($result, true);
182
+        $json = json_decode( $result, true );
183 183
 
184
-        $this->assertNotEquals(null, $json);
184
+        $this->assertNotEquals( null, $json );
185 185
     }
186 186
 }
187 187
\ No newline at end of file
Please login to merge, or discard this patch.