Skip to content

Commit

Permalink
Merge 80c826f into 3f7f388
Browse files Browse the repository at this point in the history
  • Loading branch information
padarom committed Jun 29, 2018
2 parents 3f7f388 + 80c826f commit 0a88751
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $countries = \Countries::getByRegion(\Countries::$REGION_AMERICAS);
$countries = \Countries::getByRegion(\Countries::$REGION_ASIA);
$countries = \Countries::getByRegion(\Countries::$REGION_EUROPE);
$countries = \Countries::getByRegion(\Countries::$REGION_OCEANIA);
$countries = \Countries::getByRegion(\Countries::$REGION_NONE); // Antarctica amongst others.
$countries = \Countries::getByRegion(\Countries::$REGION_ANTARCTIC);
```

Results will be returned as Country objects. These objects have the following helper methods :
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
],
"require": {
"illuminate/support": "~5.1",
"mledoze/countries": "~1.8"
"mledoze/countries": "~2.0"
},
"require-dev": {
"phpunit/phpunit" : "~5.2",
"phpunit/phpunit" : "~7.0",
"mockery/mockery": "0.9.*",
"orchestra/testbench": "~3.1",
"orchestra/testbench": "~3.6",
"satooshi/php-coveralls": "~1.0",
"illuminate/foundation": "^5.1.3"
"laravel/framework": "^5.6"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/RegionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ trait RegionsTrait
public static $REGION_ASIA = 'Asia';
public static $REGION_EUROPE = 'Europe';
public static $REGION_OCEANIA = 'Oceania';
public static $REGION_NONE = '';
public static $REGION_ANTARCTIC = 'Antarctic';
}
2 changes: 1 addition & 1 deletion tests/CountriesRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function it_gets_countries_by_region()
/** @test */
public function it_gets_countries_by_subregion()
{
$results = $this->countries->getBySubregion('Northern America');
$results = $this->countries->getBySubregion('North America');
$codes = array_column($results, 'cca2');

$this->assertContainsOnlyInstancesOf(\Lykegenes\LaravelCountries\Country::class, $results);
Expand Down
6 changes: 3 additions & 3 deletions tests/RegionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ public function it_makes_sure_regions_names_have_not_changed()
$asia = $this->countries->getByRegion(\Countries::$REGION_ASIA);
$europe = $this->countries->getByRegion(\Countries::$REGION_EUROPE);
$oceania = $this->countries->getByRegion(\Countries::$REGION_OCEANIA);
$others = $this->countries->getByRegion(\Countries::$REGION_NONE);
$antarctic = $this->countries->getByRegion(\Countries::$REGION_ANTARCTIC);

// No region should be empty
$this->assertNotEmpty($africa);
$this->assertNotEmpty($americas);
$this->assertNotEmpty($asia);
$this->assertNotEmpty($europe);
$this->assertNotEmpty($oceania);
$this->assertNotEmpty($others);
$this->assertNotEmpty($antarctic);

// Make sure the totals match
$this->assertEquals(count($this->countries->getRawData()),
count($africa) + count($americas) + count($asia) + count($europe) + count($oceania) + count($others));
count($africa) + count($americas) + count($asia) + count($europe) + count($oceania) + count($antarctic));
}
}

0 comments on commit 0a88751

Please sign in to comment.