@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | class AddressBookLocationUnitTests extends \PHPUnit\Framework\TestCase |
11 | 11 | { |
12 | - public static $createdContacts=[]; |
|
12 | + public static $createdContacts = []; |
|
13 | 13 | |
14 | - public static $csvImportedAddressIDs=[]; |
|
14 | + public static $csvImportedAddressIDs = []; |
|
15 | 15 | |
16 | 16 | public static function setUpBeforeClass() |
17 | 17 | { |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | 'limit' => 5, |
191 | 191 | ]; |
192 | 192 | |
193 | - $result = SearchResponse::fromArray( |
|
193 | + $result = SearchResponse::fromArray( |
|
194 | 194 | $abl->searchAddressBookLocations($params) |
195 | 195 | ); |
196 | 196 | |
197 | 197 | $this->assertNotNull($result); |
198 | 198 | $this->assertTrue(sizeof($result->fields)==6); |
199 | - $this->assertContains('first_name',$result->fields); |
|
200 | - $this->assertContains('address_email',$result->fields); |
|
199 | + $this->assertContains('first_name', $result->fields); |
|
200 | + $this->assertContains('address_email', $result->fields); |
|
201 | 201 | |
202 | 202 | $this->assertNotNull($result->results); |
203 | 203 | |
@@ -344,11 +344,11 @@ discard block |
||
344 | 344 | public function testValidateScheduleMonthlyMode() |
345 | 345 | { |
346 | 346 | $this->assertTrue(AddressBookLocation::validateScheduleMonthlyMode('dates')); |
347 | - $this->assertTrue(AddressBookLocation::validateScheduleMonthlyMode('nth' )); |
|
347 | + $this->assertTrue(AddressBookLocation::validateScheduleMonthlyMode('nth')); |
|
348 | 348 | |
349 | - $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode('wrongParam' )); |
|
350 | - $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode(4 )); |
|
351 | - $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode(true )); |
|
349 | + $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode('wrongParam')); |
|
350 | + $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode(4)); |
|
351 | + $this->assertFalse(AddressBookLocation::validateScheduleMonthlyMode(true)); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | public function testValidateScheduleMonthlyDates() |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | public function testValidateScheduleNthWhat() |
385 | 385 | { |
386 | - for ($i=1;$i<11;$i++) $this->assertTrue(AddressBookLocation::validateScheduleNthWhat($i)); |
|
386 | + for ($i = 1; $i<11; $i++) $this->assertTrue(AddressBookLocation::validateScheduleNthWhat($i)); |
|
387 | 387 | |
388 | 388 | $this->assertFalse(AddressBookLocation::validateScheduleNthWhat(0)); |
389 | 389 | $this->assertFalse(AddressBookLocation::validateScheduleNthWhat(14)); |
@@ -439,13 +439,13 @@ discard block |
||
439 | 439 | |
440 | 440 | public static function tearDownAfterClass() |
441 | 441 | { |
442 | - $addressBookLocations=[]; |
|
442 | + $addressBookLocations = []; |
|
443 | 443 | |
444 | 444 | foreach (self::$createdContacts as $createdContact) { |
445 | 445 | $addressBookLocations[] = $createdContact->address_id; |
446 | 446 | } |
447 | 447 | |
448 | - $addressBookLocations = array_merge($addressBookLocations,self::$csvImportedAddressIDs); |
|
448 | + $addressBookLocations = array_merge($addressBookLocations, self::$csvImportedAddressIDs); |
|
449 | 449 | |
450 | 450 | $abl = new AddressBookLocation(); |
451 | 451 |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | public static function setUpBeforeClass() |
34 | 34 | { |
35 | - if (Constants::API_KEY == Constants::DEMO_API_KEY) { |
|
36 | - $className = str_replace('UnitTestFiles\\Test\\','',get_class()); |
|
37 | - self::markTestSkipped( 'PHPUnit will skip '. $className ." class - it impossible run with demo API key" ); |
|
35 | + if (Constants::API_KEY==Constants::DEMO_API_KEY) { |
|
36 | + $className = str_replace('UnitTestFiles\\Test\\', '', get_class()); |
|
37 | + self::markTestSkipped('PHPUnit will skip '.$className." class - it impossible run with demo API key"); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | Route4Me::setApiKey(Constants::API_KEY); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'is_visited' => 1 |
125 | 125 | ]; |
126 | 126 | |
127 | - $result = $addresses[2]->markAsVisited($params); |
|
127 | + $result = $addresses[2]->markAsVisited($params); |
|
128 | 128 | |
129 | 129 | } |
130 | 130 | |
@@ -264,12 +264,12 @@ discard block |
||
264 | 264 | |
265 | 265 | $this->assertNotNull($result); |
266 | 266 | $this->assertIsInt($result); |
267 | - $this->assertEquals(1,$result); |
|
267 | + $this->assertEquals(1, $result); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | public function testDeleteAddress() |
271 | 271 | { |
272 | - $lastAddressId = self::$createdAddresses[sizeof(self::$createdAddresses)-1]->route_destination_id; |
|
272 | + $lastAddressId = self::$createdAddresses[sizeof(self::$createdAddresses) - 1]->route_destination_id; |
|
273 | 273 | |
274 | 274 | $address = Address::getAddress(self::$route_id, $lastAddressId); |
275 | 275 | $this->assertNotNull($address); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | public function testMoveDestinationToRoute() |
284 | 284 | { |
285 | - $lastAddressId = self::$createdAddresses[sizeof(self::$createdAddresses)-1]->route_destination_id; |
|
285 | + $lastAddressId = self::$createdAddresses[sizeof(self::$createdAddresses) - 1]->route_destination_id; |
|
286 | 286 | |
287 | 287 | // Move the destination to the route |
288 | 288 | $routeParams = [ |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | |
297 | 297 | $this->assertNotNull($result); |
298 | 298 | $this->assertNotNull($result['success']); |
299 | - $this->assertEquals(true,$result['success']); |
|
299 | + $this->assertEquals(true, $result['success']); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | public function testChangeRouteDepote() |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ); |
100 | 100 | |
101 | 101 | self::assertNotNull($result2); |
102 | - self::assertTrue( CreateConnectionResponse::fromArray($result2) instanceof CreateConnectionResponse); |
|
102 | + self::assertTrue(CreateConnectionResponse::fromArray($result2) instanceof CreateConnectionResponse); |
|
103 | 103 | |
104 | 104 | self::$createdConnections[] = TelematicsConnection::fromArray($result2); |
105 | 105 | //endregion |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | public function testGetAllVendors() |
327 | 327 | { |
328 | - $vendorsParameters = TelematicsVendor::fromArray( [ ] ); |
|
328 | + $vendorsParameters = TelematicsVendor::fromArray([]); |
|
329 | 329 | |
330 | 330 | $vendors = new TelematicsVendor(); |
331 | 331 | $vendorsResults = $vendors->GetTelematicsVendors($vendorsParameters); |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | |
428 | 428 | $connection = $teleConnection->getTelematicsConnection( |
429 | 429 | self::$api_token, |
430 | - self::$createdConnections[sizeof(self::$createdConnections)-1]->connection_token |
|
430 | + self::$createdConnections[sizeof(self::$createdConnections) - 1]->connection_token |
|
431 | 431 | ); |
432 | 432 | |
433 | 433 | $this->assertNotNull($connection); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | ); |
459 | 459 | |
460 | 460 | $this->assertNotNull($result); |
461 | - $this->assertTrue( CreateConnectionResponse::fromArray($result) instanceof CreateConnectionResponse); |
|
461 | + $this->assertTrue(CreateConnectionResponse::fromArray($result) instanceof CreateConnectionResponse); |
|
462 | 462 | |
463 | 463 | self::$createdConnections[] = TelematicsConnection::fromArray($result); |
464 | 464 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | $teleConParams = new TelematicsConnectionParameters(); |
469 | 469 | |
470 | 470 | $teleConParams->vehicle_position_refresh_rate = 50; |
471 | - $teleConParams->name = 'Test Telematics Connection from php SDK Updated'; |
|
471 | + $teleConParams->name = 'Test Telematics Connection from php SDK Updated'; |
|
472 | 472 | $teleConParams->validate_remote_credentials = 0; |
473 | 473 | |
474 | 474 | $teleConnection = new TelematicsConnection(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $result = $memberConfiguration->CreateNewConfigurationData($memberConfiguration->toArray(), $errorText); |
31 | 31 | |
32 | - if(isset($result['affected']) && $result['affected']==1) { |
|
32 | + if (isset($result['affected']) && $result['affected']==1) { |
|
33 | 33 | self::$createdConfigurationKeys[] = 'Test My height'; |
34 | 34 | } else { |
35 | 35 | echo "$errorText <br>"; |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | 'config_value' => 'test_value' |
45 | 45 | ]); |
46 | 46 | |
47 | - $this->assertEquals($memberConfiguration->member_id, 444444 ,"member_id != 444444"); |
|
48 | - $this->assertEquals($memberConfiguration->config_key, 'test_key' ,"config_key != 'test_key'"); |
|
49 | - $this->assertEquals($memberConfiguration->config_value, 'test_value' ,"config_value != 'test_value'"); |
|
47 | + $this->assertEquals($memberConfiguration->member_id, 444444, "member_id != 444444"); |
|
48 | + $this->assertEquals($memberConfiguration->config_key, 'test_key', "config_key != 'test_key'"); |
|
49 | + $this->assertEquals($memberConfiguration->config_value, 'test_value', "config_value != 'test_value'"); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function testToArray() |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->assertTrue(isset($result['affected']), "Wrong response for member configuration data."); |
124 | 124 | $this->assertEquals(1, $result['affected'], "Cannot create new member configuration data <br> $errorText"); |
125 | 125 | |
126 | - if($result['affected']==1) { |
|
126 | + if ($result['affected']==1) { |
|
127 | 127 | self::$createdConfigurationKeys[] = 'Test My weight'; |
128 | 128 | } |
129 | 129 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $this->assertTrue(isset($removed['affected']), "Wrong response for member configuration data."); |
174 | 174 | $this->assertEquals(1, $removed['affected'], "Cannot create new member configuration data"); |
175 | 175 | |
176 | - if($removed['affected']==1) { |
|
176 | + if ($removed['affected']==1) { |
|
177 | 177 | $key = array_search('Test My height', self::$createdConfigurationKeys); |
178 | 178 | array_splice(self::$createdConfigurationKeys, $key, 1); |
179 | 179 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $address = $optimizationParameters->addresses[0]; |
165 | 165 | |
166 | 166 | $this->assertContainsOnlyInstancesOf(Address::class, [$address]); |
167 | - $this->assertEquals(self::$addresses[0],$optimizationParameters->addresses[0]); |
|
167 | + $this->assertEquals(self::$addresses[0], $optimizationParameters->addresses[0]); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | public function testGetAddressesArray() |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | $optimizationParameters->setAddresses(self::$addresses); |
206 | 206 | |
207 | - $this->assertEquals(self::$addresses,$optimizationParameters->addresses); |
|
207 | + $this->assertEquals(self::$addresses, $optimizationParameters->addresses); |
|
208 | 208 | |
209 | 209 | $address = $optimizationParameters->addresses[0]; |
210 | 210 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | class UserTests extends \PHPUnit\Framework\TestCase |
15 | 15 | { |
16 | - public static $createdMembers=[]; |
|
16 | + public static $createdMembers = []; |
|
17 | 17 | |
18 | 18 | public static function setUpBeforeClass() |
19 | 19 | { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $member = new Member(); |
385 | 385 | $errorText = ""; |
386 | 386 | |
387 | - $memberID = self::$createdMembers[sizeof(self::$createdMembers)-1]->member_id; |
|
387 | + $memberID = self::$createdMembers[sizeof(self::$createdMembers) - 1]->member_id; |
|
388 | 388 | |
389 | 389 | // Delete member from the user's account |
390 | 390 | $params = Member::fromArray([ |
@@ -10,7 +10,7 @@ |
||
10 | 10 | // Set the api key in the Route4me class |
11 | 11 | Route4Me::setApiKey(Constants::API_KEY); |
12 | 12 | |
13 | -$gcParameters = (array) Geocoding::fromArray([ |
|
13 | +$gcParameters = (array)Geocoding::fromArray([ |
|
14 | 14 | 'offset' => 0, |
15 | 15 | 'limit' => 5, |
16 | 16 | ]); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | // Set the api key in the Route4me class |
11 | 11 | Route4Me::setApiKey(Constants::API_KEY); |
12 | 12 | |
13 | -$gcParameters = (array) Geocoding::fromArray([ |
|
13 | +$gcParameters = (array)Geocoding::fromArray([ |
|
14 | 14 | 'zipcode' => '00601', |
15 | 15 | 'housenumber' => 17, |
16 | 16 | 'offset' => 0, |
@@ -10,7 +10,7 @@ |
||
10 | 10 | // Set the api key in the Route4me class |
11 | 11 | Route4Me::setApiKey(Constants::API_KEY); |
12 | 12 | |
13 | -$gcParameters = (array) Geocoding::fromArray([ |
|
13 | +$gcParameters = (array)Geocoding::fromArray([ |
|
14 | 14 | 'zipcode' => '00601', |
15 | 15 | 'housenumber' => 17, |
16 | 16 | ]); |