diff --git a/.travis.yml b/.travis.yml index 57feb2e..6bf5a59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,29 @@ language: php php: - - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 - - hhvm + - 7.1 matrix: fast_finish: true include: - - php: 5.3 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak - php: 5.6 env: SYMFONY_VERSION='2.8.*@dev' DEPENDENCIES=dev COMPOSER_FLAGS="--prefer-stable" - php: 5.6 env: DEPENDENCIES=dev + - php: 7.1 + env: DEPENDENCIES=beta before_install: - composer self-update - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/framework-bundle=$SYMFONY_VERSION; fi - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; + - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; install: composer update $COMPOSER_FLAGS script: - - phpunit --coverage-text + - ./vendor/bin/simple-phpunit diff --git a/DependencyInjection/Compiler/AddProvidersPass.php b/DependencyInjection/Compiler/AddProvidersPass.php index 8d0eb1c..66a5573 100644 --- a/DependencyInjection/Compiler/AddProvidersPass.php +++ b/DependencyInjection/Compiler/AddProvidersPass.php @@ -18,6 +18,7 @@ public function process(ContainerBuilder $container) $container ->getDefinition('faker.generator') ->addMethodCall('addProvider', array(new Reference($id))) + ->setPublic(true) ; } } diff --git a/Resources/config/services.xml b/Resources/config/services.xml index dd59fb5..6826255 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -1,23 +1,34 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> Faker\Factory Faker\ORM\Propel\Populator Faker\ORM\Propel\EntityPopulator + Bazinga\Bundle\FakerBundle\Command\PopulateCommand + + - + + + + + + + + + diff --git a/Tests/DependencyInjection/Compiler/AddProvidersPassTest.php b/Tests/DependencyInjection/Compiler/AddProvidersPassTest.php index 8f1ea03..79e5cd2 100644 --- a/Tests/DependencyInjection/Compiler/AddProvidersPassTest.php +++ b/Tests/DependencyInjection/Compiler/AddProvidersPassTest.php @@ -16,10 +16,13 @@ public function testProviderIsAdded() $targetService = new Definition(); $targetService->setClass('Faker\Generator'); - $provider = $this->getMock('Acme\Faker\Provider\CustomFakeDataProvider'); + $provider = $this->getMockBuilder('Acme\Faker\Provider\CustomFakeDataProvider')->getMock(); $providerService = new Definition(); $providerService->setClass(get_class($provider)); - $providerService->addTag('bazinga_faker.provider'); + $providerService + ->addTag('bazinga_faker.provider') + ->setPublic(true) + ; $builder = new ContainerBuilder(); $builder->addDefinitions(array( diff --git a/Tests/Factory/FormatterFactoryTest.php b/Tests/Factory/FormatterFactoryTest.php index 50a6f58..86a8e4f 100644 --- a/Tests/Factory/FormatterFactoryTest.php +++ b/Tests/Factory/FormatterFactoryTest.php @@ -17,7 +17,11 @@ class FormatterFactoryTest extends TestCase { public function testCreateClosureWithoutParameters() { - $generator = $this->getMock('Faker\Generator', array('foo')); + $generator = $this + ->getMockBuilder('Faker\Generator') + ->setMethods(array('foo', 'optional')) + ->getMock() + ; $generator ->expects($this->once()) ->method('foo') @@ -35,7 +39,11 @@ public function testCreateClosureWithoutParameters() public function testCreateClosureWithOptional() { - $generator = $this->getMock('Faker\Generator', array('foo','optional')); + $generator = $this + ->getMockBuilder('Faker\Generator') + ->setMethods(array('foo','optional')) + ->getMock() + ; $generator ->expects($this->once()) ->method('foo') @@ -66,7 +74,11 @@ public function withParameterProvider() */ public function testCreateClosureWithParameters(array $parameters) { - $generator = $this->getMock('Faker\Generator', array('foo')); + $generator = $this + ->getMockBuilder('Faker\Generator') + ->setMethods(array('foo')) + ->getMock() + ; $matcher = $generator ->expects($this->once()) ->method('foo') diff --git a/Tests/TestCase.php b/Tests/TestCase.php index 326dc8f..87d13a7 100644 --- a/Tests/TestCase.php +++ b/Tests/TestCase.php @@ -13,6 +13,6 @@ /** * @author William Durand */ -class TestCase extends \PHPUnit_Framework_TestCase +class TestCase extends \PHPUnit\Framework\TestCase { } diff --git a/composer.json b/composer.json index 432b378..d047b48 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ ], "require": { "php": ">=5.3", - "symfony/framework-bundle": "~2.3|~3.0", + "symfony/framework-bundle": "~2.3|~3.0|^4.0", "fzaninotto/faker": "~1.3" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/phpunit-bridge": "^4.0" }, "autoload": { "psr-0": { "Bazinga\\Bundle\\FakerBundle": "" }