Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Hall committed Oct 25, 2019
1 parent 899cad8 commit 014b90e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
4 changes: 1 addition & 3 deletions src/Objects/PostcodesIo.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace DivineOmega\Postcodes\Objects;


use DivineOmega\Postcodes\Interfaces\PostcodeServiceInterface;
use Exception;
use GuzzleHttp\Client;
Expand Down Expand Up @@ -71,4 +69,4 @@ private function parseResponse(Response $response)

return $addresses;
}
}
}
27 changes: 11 additions & 16 deletions tests/Unit/PostcodesIoTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php

use DivineOmega\Postcodes\Exceptions\InvalidPostcodeException;
use DivineOmega\Postcodes\Objects\PostcodesIo;
use DivineOmega\Postcodes\Utils\Generator;
use DivineOmega\Postcodes\Utils\Tokenizer;
use DivineOmega\Postcodes\Utils\Validator;
use PHPUnit\Framework\TestCase;

final class PostcodesIoTest extends TestCase
Expand All @@ -13,23 +9,23 @@ public function validationProvider()
{
return [
[
'postcode' => 'ST163DP',
'postcode' => 'ST163DP',
'expectedResponse' => [
'townCity' => 'Stafford',
'county' => 'Staffordshire',
'postcode' => 'ST16 3DP',
'townCity' => 'Stafford',
'county' => 'Staffordshire',
'postcode' => 'ST16 3DP',
'longitude' => -2.11556,
'latitude' => 52.822944,
'latitude' => 52.822944,
],
],
[
'postcode' => 'TN30YA',
'postcode' => 'TN30YA',
'expectedResponse' => [
'townCity' => 'Tunbridge Wells',
'county' => 'Kent',
'postcode' => 'TN3 0YA',
'townCity' => 'Tunbridge Wells',
'county' => 'Kent',
'postcode' => 'TN3 0YA',
'longitude' => 0.226856,
'latitude' => 51.13246,
'latitude' => 51.13246,
],
],
];
Expand All @@ -45,9 +41,8 @@ public function testLookup($postcode, $expectedResponse)

$address = $addresses[0];

foreach($expectedResponse as $key => $value) {
foreach ($expectedResponse as $key => $value) {
$this->assertEquals($value, $address->$key);
}
}

}

0 comments on commit 014b90e

Please sign in to comment.