Skip to content

Commit

Permalink
Drop PHP 5 support completely, upgrade to PHPUnit 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanz committed Jan 24, 2020
1 parent 5a8a5c6 commit 71b02d5
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 32 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ php:
- 7.2
- 7.1
- 7.0
- 5.6

install:
- composer self-update
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ addressing

[![Build Status](https://travis-ci.org/commerceguys/addressing.svg?branch=master)](https://travis-ci.org/commerceguys/addressing)

A PHP 5.5+ addressing library, powered by CLDR and Google's address data.
A PHP 7.0+ addressing library, powered by CLDR and Google's address data.

Manipulates postal addresses, meant to identify a precise recipient location for shipping or billing purposes.

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"keywords": ["postal", "address", "internationalization", "localization"],
"license": "MIT",
"require": {
"php": ">=5.5.0",
"php": ">=7.0.8",
"doctrine/collections": "~1.0"
},
"require-dev": {
"symfony/validator": ">=3.2",
"phpunit/phpunit": "~4.0",
"symfony/validator": "^3.4",
"phpunit/phpunit": "^6.0",
"mikey179/vfsstream": "1.*",
"squizlabs/php_codesniffer": "2.*"
},
Expand Down
3 changes: 2 additions & 1 deletion tests/AbstractEnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace CommerceGuys\Addressing\Tests;

use CommerceGuys\Addressing\Subdivision\PatternType;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\AbstractEnum
*/
class AbstractEnumTest extends \PHPUnit_Framework_TestCase
final class AbstractEnumTest extends TestCase
{
/**
* @covers ::getAll
Expand Down
3 changes: 2 additions & 1 deletion tests/AddressFormat/AddressFormatHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use CommerceGuys\Addressing\AddressFormat\AddressFormatHelper;
use CommerceGuys\Addressing\AddressFormat\FieldOverride;
use CommerceGuys\Addressing\AddressFormat\FieldOverrides;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\AddressFormat\AddressFormatHelper
*/
class AddressFormatHelperTest extends \PHPUnit_Framework_TestCase
final class AddressFormatHelperTest extends TestCase
{
/**
* @covers ::getGroupedFields
Expand Down
3 changes: 2 additions & 1 deletion tests/AddressFormat/AddressFormatRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use CommerceGuys\Addressing\AddressFormat\AdministrativeAreaType;
use CommerceGuys\Addressing\AddressFormat\LocalityType;
use CommerceGuys\Addressing\AddressFormat\PostalCodeType;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\AddressFormat\AddressFormatRepository
*/
class AddressFormatRepositoryTest extends \PHPUnit_Framework_TestCase
final class AddressFormatRepositoryTest extends TestCase
{
/**
* @covers ::get
Expand Down
3 changes: 2 additions & 1 deletion tests/AddressFormat/AddressFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
use CommerceGuys\Addressing\AddressFormat\DependentLocalityType;
use CommerceGuys\Addressing\AddressFormat\LocalityType;
use CommerceGuys\Addressing\AddressFormat\PostalCodeType;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\AddressFormat\AddressFormat
*/
class AddressFormatTest extends \PHPUnit_Framework_TestCase
final class AddressFormatTest extends TestCase
{
/**
* @covers ::__construct
Expand Down
3 changes: 2 additions & 1 deletion tests/AddressFormat/FieldOverridesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
use CommerceGuys\Addressing\AddressFormat\AddressField;
use CommerceGuys\Addressing\AddressFormat\FieldOverride;
use CommerceGuys\Addressing\AddressFormat\FieldOverrides;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\AddressFormat\FieldOverrides
*/
class FieldOverridesTest extends \PHPUnit_Framework_TestCase
final class FieldOverridesTest extends TestCase
{
/**
* @covers ::__construct
Expand Down
3 changes: 2 additions & 1 deletion tests/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace CommerceGuys\Addressing\Tests;

use CommerceGuys\Addressing\Address;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Address
*/
class AddressTest extends \PHPUnit_Framework_TestCase
final class AddressTest extends TestCase
{
/**
* @covers ::__construct
Expand Down
3 changes: 2 additions & 1 deletion tests/Country/CountryRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
use CommerceGuys\Addressing\Country\Country;
use CommerceGuys\Addressing\Country\CountryRepository;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Country\CountryRepository
*/
class CountryRepositoryTest extends \PHPUnit_Framework_TestCase
final class CountryRepositoryTest extends TestCase
{
/**
* Country definitions.
Expand Down
6 changes: 4 additions & 2 deletions tests/Country/CountryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
namespace CommerceGuys\Addressing\Tests\Country;

use CommerceGuys\Addressing\Country\Country;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Country\Country
*/
class CountryTest extends \PHPUnit_Framework_TestCase
final class CountryTest extends TestCase
{
/**
* @covers ::__construct
*/
public function testMissingProperty()
{
$this->setExpectedException(\InvalidArgumentException::class, 'Missing required property "country_code".');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Missing required property "country_code".');
$country = new Country([]);
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Formatter/DefaultFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use CommerceGuys\Addressing\Country\CountryRepository;
use CommerceGuys\Addressing\Formatter\DefaultFormatter;
use CommerceGuys\Addressing\Subdivision\SubdivisionRepository;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Formatter\DefaultFormatter
*/
class DefaultFormatterTest extends \PHPUnit_Framework_TestCase
final class DefaultFormatterTest extends TestCase
{
/**
* The address format repository.
Expand Down Expand Up @@ -44,7 +45,7 @@ class DefaultFormatterTest extends \PHPUnit_Framework_TestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
$this->addressFormatRepository = new AddressFormatRepository();
$this->countryRepository = new CountryRepository();
Expand Down
5 changes: 3 additions & 2 deletions tests/Formatter/PostalLabelFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use CommerceGuys\Addressing\Country\CountryRepository;
use CommerceGuys\Addressing\Formatter\PostalLabelFormatter;
use CommerceGuys\Addressing\Subdivision\SubdivisionRepository;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Formatter\PostalLabelFormatter
*/
class PostalLabelFormatterTest extends \PHPUnit_Framework_TestCase
final class PostalLabelFormatterTest extends TestCase
{
/**
* The address format repository.
Expand Down Expand Up @@ -44,7 +45,7 @@ class PostalLabelFormatterTest extends \PHPUnit_Framework_TestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
$this->addressFormatRepository = new AddressFormatRepository();
$this->countryRepository = new CountryRepository();
Expand Down
5 changes: 3 additions & 2 deletions tests/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use CommerceGuys\Addressing\Exception\UnknownLocaleException;
use CommerceGuys\Addressing\Locale;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Locale
*/
class LocaleTest extends \PHPUnit_Framework_TestCase
final class LocaleTest extends TestCase
{
/**
* @covers ::match
Expand Down Expand Up @@ -57,7 +58,7 @@ public function testResolve()
*/
public function testResolveWithoutResult()
{
$this->setExpectedException(UnknownLocaleException::class);
$this->expectException(UnknownLocaleException::class);
$availableLocales = ['bs', 'en'];
$locale = Locale::resolve($availableLocales, 'de');
}
Expand Down
3 changes: 2 additions & 1 deletion tests/PostalCodeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace CommerceGuys\Addressing\Tests;

use CommerceGuys\Addressing\PostalCodeHelper;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\PostalCodeHelper
*/
class PostalCodeHelperTest extends \PHPUnit_Framework_TestCase
final class PostalCodeHelperTest extends TestCase
{
/**
* @covers ::match
Expand Down
5 changes: 3 additions & 2 deletions tests/Subdivision/LazySubdivisionCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace CommerceGuys\Addressing\Tests\Subdivision;

use CommerceGuys\Addressing\Subdivision\LazySubdivisionCollection;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Subdivision\LazySubdivisionCollection
*/
class LazySubdivisionCollectionTest extends \PHPUnit_Framework_TestCase
final class LazySubdivisionCollectionTest extends TestCase
{
/**
* @var LazySubdivisionCollection
Expand All @@ -17,7 +18,7 @@ class LazySubdivisionCollectionTest extends \PHPUnit_Framework_TestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
$this->collection = new LazySubdivisionCollection(['BR', 'Porto Acre']);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/Subdivision/SubdivisionRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
use CommerceGuys\Addressing\Subdivision\Subdivision;
use CommerceGuys\Addressing\Subdivision\SubdivisionRepository;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Subdivision\SubdivisionRepository
*/
class SubdivisionRepositoryTest extends \PHPUnit_Framework_TestCase
final class SubdivisionRepositoryTest extends TestCase
{
/**
* Subdivisions.
Expand Down
3 changes: 2 additions & 1 deletion tests/Subdivision/SubdivisionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
use CommerceGuys\Addressing\Subdivision\PatternType;
use CommerceGuys\Addressing\Subdivision\Subdivision;
use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Subdivision\Subdivision
*/
class SubdivisionTest extends \PHPUnit_Framework_TestCase
final class SubdivisionTest extends TestCase
{
/**
* @covers ::__construct
Expand Down
3 changes: 2 additions & 1 deletion tests/UpdateHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace CommerceGuys\Addressing\Tests;

use CommerceGuys\Addressing\UpdateHelper;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\UpdateHelper
*/
class UpdateHelperTest extends \PHPUnit_Framework_TestCase
final class UpdateHelperTest extends TestCase
{
/**
* @covers ::splitRecipient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @coversDefaultClass \CommerceGuys\Addressing\Validator\Constraints\AddressFormatConstraintValidator
*/
class AddressFormatConstraintValidatorTest extends ConstraintValidatorTestCase
final class AddressFormatConstraintValidatorTest extends ConstraintValidatorTestCase
{
/**
* @var AddressFormatConstraint
Expand All @@ -23,7 +23,7 @@ class AddressFormatConstraintValidatorTest extends ConstraintValidatorTestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
$this->constraint = new AddressFormatConstraint();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @coversDefaultClass \CommerceGuys\Addressing\Validator\Constraints\CountryConstraintValidator
*/
class CountryConstraintValidatorTest extends ConstraintValidatorTestCase
final class CountryConstraintValidatorTest extends ConstraintValidatorTestCase
{
/**
* @var CountryConstraint
Expand All @@ -19,7 +19,7 @@ class CountryConstraintValidatorTest extends ConstraintValidatorTestCase
/**
* {@inheritdoc}
*/
public function setUp()
protected function setUp()
{
$this->constraint = new CountryConstraint();

Expand Down
3 changes: 2 additions & 1 deletion tests/Zone/ZoneTerritoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use CommerceGuys\Addressing\Address;
use CommerceGuys\Addressing\Zone\ZoneTerritory;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Zone\ZoneTerritory
*/
class ZoneTerritoryTest extends \PHPUnit_Framework_TestCase
final class ZoneTerritoryTest extends TestCase
{
/**
* @covers ::__construct
Expand Down
3 changes: 2 additions & 1 deletion tests/Zone/ZoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use CommerceGuys\Addressing\Address;
use CommerceGuys\Addressing\Zone\Zone;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Addressing\Zone\Zone
*/
class ZoneTest extends \PHPUnit_Framework_TestCase
final class ZoneTest extends TestCase
{
/**
* @covers ::__construct
Expand Down

0 comments on commit 71b02d5

Please sign in to comment.