Skip to content

[PhpUnitBridge] Remove use of ForwardCompatTrait #32889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
global:
- MIN_PHP=5.5.9
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/versions/5.6/bin/php
- SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1

matrix:
include:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\ContainerAwareEventManager;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\DependencyInjection\Container;

class ContainerAwareEventManagerTest extends TestCase
{
use ForwardCompatTestTrait;

private $container;
private $evm;

private function doSetUp()
protected function setUp()
{
$this->container = new Container();
$this->evm = new ContainerAwareEventManager($this->container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

class RegisterEventListenersAndSubscribersPassTest extends TestCase
{
use ForwardCompatTestTrait;

public function testExceptionOnAbstractTaggedSubscriber()
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterMappingsPass;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

class RegisterMappingsPassTest extends TestCase
{
use ForwardCompatTestTrait;

public function testNoDriverParmeterException()
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
Expand All @@ -22,14 +21,12 @@
*/
class DoctrineExtensionTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @var \Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension
*/
private $extension;

private function doSetUp()
protected function setUp()
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;

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

/**
* @var ChoiceListFactoryInterface|\PHPUnit_Framework_MockObject_MockObject
*/
Expand Down Expand Up @@ -74,7 +71,7 @@ class DoctrineChoiceLoaderTest extends TestCase
*/
private $obj3;

private function doSetUp()
protected function setUp()
{
$this->factory = $this->getMockBuilder('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface')->getMock();
$this->om = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@
use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class CollectionToArrayTransformerTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @var CollectionToArrayTransformer
*/
private $transformer;

private function doSetUp()
protected function setUp()
{
$this->transformer = new CollectionToArrayTransformer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@
use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\EventListener\MergeDoctrineCollectionListener;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;

class MergeDoctrineCollectionListenerTest extends TestCase
{
use ForwardCompatTestTrait;

/** @var \Doctrine\Common\Collections\ArrayCollection */
private $collection;
/** @var \Symfony\Component\EventDispatcher\EventDispatcher */
private $dispatcher;
private $factory;
private $form;

private function doSetUp()
protected function setUp()
{
$this->collection = new ArrayCollection(['test']);
$this->dispatcher = new EventDispatcher();
Expand All @@ -40,7 +37,7 @@ private function doSetUp()
->getForm();
}

private function doTearDown()
protected function tearDown()
{
$this->collection = null;
$this->dispatcher = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Form\Extension\Core\CoreExtension;
use Symfony\Component\Form\Test\FormPerformanceTestCase;

Expand All @@ -24,8 +23,6 @@
*/
class EntityTypePerformanceTest extends FormPerformanceTestCase
{
use ForwardCompatTestTrait;

const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';

/**
Expand Down Expand Up @@ -53,7 +50,7 @@ protected function getExtensions()
];
}

private function doSetUp()
protected function setUp()
{
$this->em = DoctrineTestHelper::createTestEntityManager();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringCastableIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
use Symfony\Component\Form\Forms;
Expand All @@ -37,8 +36,6 @@

class EntityTypeTest extends BaseTypeTest
{
use ForwardCompatTestTrait;

const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';

const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity';
Expand All @@ -62,7 +59,7 @@ class EntityTypeTest extends BaseTypeTest

protected static $supportedFeatureSetVersion = 304;

private function doSetUp()
protected function setUp()
{
$this->em = DoctrineTestHelper::createTestEntityManager();
$this->emRegistry = $this->createRegistryMock('default', $this->em);
Expand Down Expand Up @@ -92,7 +89,7 @@ private function doSetUp()
}
}

private function doTearDown()
protected function tearDown()
{
parent::tearDown();

Expand Down
5 changes: 1 addition & 4 deletions src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\ManagerRegistry;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\ProxyManager\Tests\LazyProxy\Dumper\PhpDumperTest;

class ManagerRegistryTest extends TestCase
{
use ForwardCompatTestTrait;

private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
if (!class_exists('PHPUnit_Framework_TestCase')) {
self::markTestSkipped('proxy-manager-bridge is not yet compatible with namespaced phpunit versions.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@
use Doctrine\ORM\Tools\Setup;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\PropertyInfo\Type;

/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class DoctrineExtractorTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @var DoctrineExtractor
*/
private $extractor;

private function doSetUp()
protected function setUp()
{
$config = Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true);
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
use Symfony\Bridge\Doctrine\Security\User\EntityUserProvider;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use Symfony\Bridge\Doctrine\Tests\Fixtures\User;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;

class EntityUserProviderTest extends TestCase
{
use ForwardCompatTestTrait;

public function testRefreshUserGetsUserByPrimaryKey()
{
$em = DoctrineTestHelper::createTestEntityManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@
use Symfony\Bridge\Doctrine\Tests\Fixtures\Type\StringWrapper;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
{
use ForwardCompatTestTrait;

const EM_NAME = 'foo';

/**
Expand All @@ -61,7 +58,7 @@ class UniqueEntityValidatorTest extends ConstraintValidatorTestCase

protected $repositoryFactory;

private function doSetUp()
protected function setUp()
{
$this->repositoryFactory = new TestRepositoryFactory();

Expand Down
7 changes: 2 additions & 5 deletions src/Symfony/Bridge/PhpUnit/Tests/ClockMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ClockMock;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;

/**
* @author Dominic Tubach <dominic.tubach@to.com>
Expand All @@ -22,14 +21,12 @@
*/
class ClockMockTest extends TestCase
{
use ForwardCompatTestTrait;

private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
ClockMock::register(__CLASS__);
}

private function doSetUp()
protected function setUp()
{
ClockMock::withClockMock(1234567890.125);
}
Expand Down
5 changes: 1 addition & 4 deletions src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\DnsMock;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;

class DnsMockTest extends TestCase
{
use ForwardCompatTestTrait;

private function doTearDown()
protected function tearDown()
{
DnsMock::withMockedHosts(array());
}
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Bridge/PhpUnit/Tests/ProcessIsolationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Symfony\Bridge\PhpUnit\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;

/**
* Don't remove this test case, it tests the legacy group.
Expand All @@ -14,8 +13,6 @@
*/
class ProcessIsolationTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @expectedDeprecation Test abc
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\Instantiator;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -23,8 +22,6 @@
*/
class RuntimeInstantiatorTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @var RuntimeInstantiator
*/
Expand All @@ -33,7 +30,7 @@ class RuntimeInstantiatorTest extends TestCase
/**
* {@inheritdoc}
*/
private function doSetUp()
protected function setUp()
{
$this->instantiator = new RuntimeInstantiator();
}
Expand Down
Loading