Skip to content

Commit

Permalink
Unit testing postcodes seperated with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Hall committed Mar 9, 2018
1 parent 1b75237 commit 67473e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/Unit/BasicUsageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class BasicUsageTest extends TestCase
{
public function testValidation()
{
$postcodes = ['ST163DP', 'TN30YA', 'ST78PP', 'CM233WE', 'E16AW', 'E106QX'];
$postcodes = ['ST163DP', 'TN30YA', 'ST78PP', 'CM233WE', 'E16AW', 'E106QX', 'ST16 3DP'];

foreach($postcodes as $postcode) {
$this->assertTrue(Validator::validatePostcode($postcode));
Expand All @@ -19,7 +19,7 @@ public function testValidation()

public function testValidationFailure()
{
$postcodes = ['ST163DPA', 'XF2P90', 'Ollie', 'cake'];
$postcodes = ['ST163DPA', 'XF2P90', 'Ollie', 'cake', 'ST16 3DPA'];

foreach($postcodes as $postcode) {
$this->assertFalse(Validator::validatePostcode($postcode));
Expand Down Expand Up @@ -71,6 +71,16 @@ public function testOutwardAndInwardCodes()
'postcode' => 'E106QX',
'outward' => 'E10',
'inward' => '6QX'
],
[
'postcode' => 'ST16 3DP',
'outward' => 'ST16',
'inward' => '3DP'
],
[
'postcode' => 'E1 6AW',
'outward' => 'E1',
'inward' => '6AW'
]
];

Expand Down

0 comments on commit 67473e0

Please sign in to comment.