Skip to content

Commit

Permalink
Fix PHPUnit deprecations (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored Oct 3, 2020
1 parent 95b6f41 commit 7165a10
Show file tree
Hide file tree
Showing 26 changed files with 89 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/fixtures/Bridge/Propel2/Model/
!/fixtures/Bridge/Propel2/Model/.gitkeep
/fixtures/Bridge/Symfony/SymfonyApp/cache/*
/var
/phpunit.xml
/.php_cs.cache
/.phar/
Expand All @@ -19,3 +20,4 @@
!/bin/doctrine_purge
!/bin/eloquent_migrate
!/bin/eloquent_rollback
/.phpunit.result.cache
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ cache:
- $HOME/.composer/cache/files

php:
- '7.3'
- '7.3'
- '7.4'

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
"bamarni/composer-bin-plugin": "^1.1",
"phpspec/prophecy": "^1.6",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^8.5.4 || ^9.0",
"phpunit/phpunit": "^9.3",
"symfony/phpunit-bridge": "^5.1.3"
},
"conflict": {
"doctrine/orm": "<2.5",
"doctrine/orm": "<2.6.3",
"illuminate/database": "<5.5",
"ocramius/proxy-manager": "<2.1",
"symfony/framework-bundle": "<3.4"
"symfony/framework-bundle": "<3.4",
"zendframework/zend-code": "<3.3.1"
},
"suggest": {
"doctrine/data-fixtures": "To use Doctrine",
Expand Down
14 changes: 7 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src</directory>
<exclude>
<directory>src/Bridge</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory>src/Bridge</directory>
</exclude>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_doctrine.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Doctrine</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_doctrine_mongodb.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Doctrine</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_doctrine_phpcr.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Doctrine</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_eloquent.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Eloquent</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_propel2.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Propel2</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
17 changes: 10 additions & 7 deletions phpunit_symfony.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Symfony</directory>
<exclude>tests/Bridge/Symfony/Doctrine</exclude>
<exclude>tests/Bridge/Symfony/Eloquent</exclude>
<exclude>tests/Bridge/Symfony/ProxyManager</exclude>
</whitelist>
</filter>
</include>

<exclude>
<directory>tests/Bridge/Symfony/Doctrine</directory>
<directory>tests/Bridge/Symfony/Eloquent</directory>
<directory>tests/Bridge/Symfony/ProxyManager</directory>
</exclude>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_symfony_doctrine.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Symfony/Doctrine</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_symfony_eloquent.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Symfony/Eloquent</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_symfony_proxy_manager_with_doctrine.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>src/Bridge/Symfony/Doctrine</directory>
</whitelist>
</filter>
</include>
</coverage>

</phpunit>
8 changes: 4 additions & 4 deletions phpunit_symfony_proxy_manager_with_eloquent.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<includec>
<directory>tests/Bridge/Symfony/Eloquent</directory>
</whitelist>
</filter>
</includec>
</coverage>

</phpunit>
3 changes: 3 additions & 0 deletions tests/Bridge/Doctrine/Purger/PurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
use Fidry\AliceDataFixtures\Persistence\PurgerFactoryInterface;
use Fidry\AliceDataFixtures\Persistence\PurgerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;

/**
* @covers \Fidry\AliceDataFixtures\Bridge\Doctrine\Purger\Purger
*/
class PurgerTest extends TestCase
{
use ProphecyTrait;

public function testIsAPurger()
{
$this->assertTrue(is_a(Purger::class, PurgerInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Bridge/DoctrineMongoDB/Purger/PurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Fidry\AliceDataFixtures\Bridge\Doctrine\MongoDocument\Dummy;
use Fidry\AliceDataFixtures\Bridge\Doctrine\Purger\Purger;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

/**
* @covers \Fidry\AliceDataFixtures\Bridge\Doctrine\Purger\Purger
Expand All @@ -26,6 +27,8 @@
*/
class PurgerTest extends TestCase
{
use ProphecyTrait;

public function testCreatesADoctrineOdmPurgerWithTheAppropriateManager()
{
$manager = $this->prophesize(DocumentManager::class)->reveal();
Expand Down
3 changes: 3 additions & 0 deletions tests/Bridge/DoctrinePhpCr/Purger/PurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
use Fidry\AliceDataFixtures\Persistence\PurgerFactoryInterface;
use Fidry\AliceDataFixtures\Persistence\PurgerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;

/**
* @covers \Fidry\AliceDataFixtures\Bridge\Doctrine\Purger\Purger
*/
class PurgerTest extends TestCase
{
use ProphecyTrait;

public function testIsAPurger()
{
$this->assertTrue(is_a(Purger::class, PurgerInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Bridge/Eloquent/Purger/ModelPurgerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Illuminate\Database\Migrations\Migrator;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use ReflectionClass;

Expand All @@ -32,6 +33,8 @@
*/
class ModelPurgerTest extends TestCase
{
use ProphecyTrait;

public function testIsAPurger()
{
$this->assertTrue(is_a(ModelPurger::class, PurgerInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Loader/FileResolverLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Fidry\AliceDataFixtures\LoaderInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

Expand All @@ -26,6 +27,8 @@
*/
class FileResolverLoaderTest extends TestCase
{
use ProphecyTrait;

public function testIsALoader()
{
$this->assertTrue(is_a(FileResolverLoader::class, LoaderInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Loader/MultiPassFileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Nelmio\Alice\Throwable\Exception\Generator\Resolver\UnresolvableValueDuringGenerationException;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

Expand All @@ -37,6 +38,8 @@
*/
class MultiPassFileLoaderTest extends TestCase
{
use ProphecyTrait;

public function testIsALoader()
{
$this->assertTrue(is_a(MultiPassLoader::class, LoaderInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Loader/PersisterLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Fidry\AliceDataFixtures\ProcessorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

Expand All @@ -28,6 +29,8 @@
*/
class PersisterLoaderTest extends TestCase
{
use ProphecyTrait;

public function testIsALoader()
{
$this->assertTrue(is_a(PersisterLoader::class, LoaderInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Loader/PurgerLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Fidry\AliceDataFixtures\Persistence\PurgerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use ReflectionClass;
use stdClass;
Expand All @@ -30,6 +31,8 @@
*/
class PurgerLoaderTest extends TestCase
{
use ProphecyTrait;

public function testIsALoader()
{
$this->assertTrue(is_a(PurgerLoader::class, LoaderInterface::class, true));
Expand Down
3 changes: 3 additions & 0 deletions tests/Loader/SimpleLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Nelmio\Alice\ParameterBag;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

Expand All @@ -28,6 +29,8 @@
*/
class SimpleLoaderTest extends TestCase
{
use ProphecyTrait;

public function testIsALoader()
{
$this->assertTrue(is_a(SimpleLoader::class, LoaderInterface::class, true));
Expand Down
1 change: 1 addition & 0 deletions vendor-bin/doctrine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"require-dev": {
"doctrine/data-fixtures": "^1.2",
"doctrine/orm": "^2.5",
"doctrine/persistence": "^1.3.4",
"theofidry/composer-inheritance-plugin": "^1.0"
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions vendor-bin/doctrine_mongodb/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"alcaeus/mongo-php-adapter": "^1.1.3",
"doctrine/data-fixtures": "^1.2",
"doctrine/mongodb-odm": "^1.2.0",
"doctrine/persistence": "^1.3.4",
"theofidry/composer-inheritance-plugin": "^1.0"
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions vendor-bin/doctrine_phpcr/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"require-dev": {
"doctrine/persistence": "^1.3.4",
"doctrine/phpcr-odm": "^1.4",
"jackalope/jackalope-doctrine-dbal": "^1.2",
"symfony/console": "^2.7 || ^3.4 || ^4.0",
Expand Down

0 comments on commit 7165a10

Please sign in to comment.