Remove use of ForwardCompatTrait

This commit is contained in:
Jérémy Derussé 2019-08-02 19:02:27 +02:00
parent 61894106d4
commit ac6242f36b
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
675 changed files with 521 additions and 2514 deletions

View File

@ -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:

View File

@ -13,17 +13,14 @@ namespace Symfony\Bridge\Doctrine\Tests;
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);

View File

@ -13,15 +13,12 @@ namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass;
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');

View File

@ -4,14 +4,11 @@ namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass;
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');

View File

@ -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;
@ -22,14 +21,12 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
*/
class DoctrineExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var \Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension
*/
private $extension;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -18,7 +18,6 @@ use PHPUnit\Framework\TestCase;
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;
@ -27,8 +26,6 @@ use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
*/
class DoctrineChoiceLoaderTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var ChoiceListFactoryInterface|\PHPUnit_Framework_MockObject_MockObject
*/
@ -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();

View File

@ -14,21 +14,18 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\DataTransformer;
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();
}

View File

@ -14,7 +14,6 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\EventListener;
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;
@ -22,8 +21,6 @@ use Symfony\Component\Form\FormEvents;
class MergeDoctrineCollectionListenerTest extends TestCase
{
use ForwardCompatTestTrait;
/** @var \Doctrine\Common\Collections\ArrayCollection */
private $collection;
/** @var \Symfony\Component\EventDispatcher\EventDispatcher */
@ -31,7 +28,7 @@ class MergeDoctrineCollectionListenerTest extends TestCase
private $factory;
private $form;
private function doSetUp()
protected function setUp()
{
$this->collection = new ArrayCollection(['test']);
$this->dispatcher = new EventDispatcher();
@ -40,7 +37,7 @@ class MergeDoctrineCollectionListenerTest extends TestCase
->getForm();
}
private function doTearDown()
protected function tearDown()
{
$this->collection = null;
$this->dispatcher = null;

View File

@ -15,7 +15,6 @@ use Doctrine\ORM\Tools\SchemaTool;
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;
@ -24,8 +23,6 @@ use Symfony\Component\Form\Test\FormPerformanceTestCase;
*/
class EntityTypePerformanceTest extends FormPerformanceTestCase
{
use ForwardCompatTestTrait;
const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
/**
@ -53,7 +50,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
];
}
private function doSetUp()
protected function setUp()
{
$this->em = DoctrineTestHelper::createTestEntityManager();

View File

@ -28,7 +28,6 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
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;
@ -37,8 +36,6 @@ use Symfony\Component\Form\Tests\Extension\Core\Type\FormTypeTest;
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';
@ -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);
@ -92,7 +89,7 @@ class EntityTypeTest extends BaseTypeTest
}
}
private function doTearDown()
protected function tearDown()
{
parent::tearDown();

View File

@ -13,14 +13,11 @@ namespace Symfony\Bridge\Doctrine\Tests;
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.');

View File

@ -16,7 +16,6 @@ use Doctrine\ORM\EntityManager;
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;
/**
@ -24,14 +23,12 @@ use Symfony\Component\PropertyInfo\Type;
*/
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);

View File

@ -16,12 +16,9 @@ use PHPUnit\Framework\TestCase;
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();

View File

@ -32,7 +32,6 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdStringWrapperNameEntity;
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;
/**
@ -40,8 +39,6 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
*/
class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
{
use ForwardCompatTestTrait;
const EM_NAME = 'foo';
/**
@ -61,7 +58,7 @@ class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
protected $repositoryFactory;
private function doSetUp()
protected function setUp()
{
$this->repositoryFactory = new TestRepositoryFactory();

View File

@ -13,7 +13,6 @@ namespace Symfony\Bridge\PhpUnit\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ClockMock;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
/**
* @author Dominic Tubach <dominic.tubach@to.com>
@ -22,14 +21,12 @@ use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
*/
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);
}

View File

@ -13,13 +13,10 @@ namespace Symfony\Bridge\PhpUnit\Tests;
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());
}

View File

@ -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.
@ -14,8 +13,6 @@ use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
*/
class ProcessIsolationTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @expectedDeprecation Test abc
*/

View File

@ -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;
@ -23,8 +22,6 @@ use Symfony\Component\DependencyInjection\Definition;
*/
class RuntimeInstantiatorTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var RuntimeInstantiator
*/
@ -33,7 +30,7 @@ class RuntimeInstantiatorTest extends TestCase
/**
* {@inheritdoc}
*/
private function doSetUp()
protected function setUp()
{
$this->instantiator = new RuntimeInstantiator();
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
@ -25,8 +24,6 @@ use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
*/
class ProxyDumperTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var ProxyDumper
*/
@ -35,7 +32,7 @@ class ProxyDumperTest extends TestCase
/**
* {@inheritdoc}
*/
private function doSetUp()
protected function setUp()
{
$this->dumper = new ProxyDumper();
}

View File

@ -3,7 +3,6 @@
namespace Symfony\Bridge\Twig\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\AppVariable;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
@ -11,14 +10,12 @@ use Symfony\Component\HttpFoundation\Session\Session;
class AppVariableTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var AppVariable
*/
protected $appVariable;
private function doSetUp()
protected function setUp()
{
$this->appVariable = new AppVariable();
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Command\LintCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\OutputInterface;
@ -22,8 +21,6 @@ use Twig\Loader\FilesystemLoader;
class LintCommandTest extends TestCase
{
use ForwardCompatTestTrait;
private $files;
public function testLintCorrectFile()
@ -114,12 +111,12 @@ class LintCommandTest extends TestCase
return $filename;
}
private function doSetUp()
protected function setUp()
{
$this->files = [];
}
private function doTearDown()
protected function tearDown()
{
foreach ($this->files as $file) {
if (file_exists($file)) {

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -23,8 +22,6 @@ use Twig\Environment;
class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3HorizontalLayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
protected $testableFeatures = [
@ -36,7 +33,7 @@ class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3Hori
*/
private $renderer;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -23,7 +22,6 @@ use Twig\Environment;
class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
/**
@ -31,7 +29,7 @@ class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
*/
private $renderer;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -28,7 +27,6 @@ use Twig\Environment;
*/
class FormExtensionBootstrap4HorizontalLayoutTest extends AbstractBootstrap4HorizontalLayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
protected $testableFeatures = [
@ -37,7 +35,7 @@ class FormExtensionBootstrap4HorizontalLayoutTest extends AbstractBootstrap4Hori
private $renderer;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -28,14 +27,13 @@ use Twig\Environment;
*/
class FormExtensionBootstrap4LayoutTest extends AbstractBootstrap4LayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
/**
* @var FormRenderer
*/
private $renderer;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -25,7 +24,6 @@ use Twig\Environment;
class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
/**
@ -35,7 +33,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
protected static $supportedFeatureSetVersion = 304;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\FormExtension;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Form\TwigRendererEngine;
@ -24,7 +23,6 @@ use Twig\Environment;
class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
{
use ForwardCompatTestTrait;
use RuntimeLoaderProvider;
/**
@ -34,7 +32,7 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
protected static $supportedFeatureSetVersion = 304;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\HttpKernelExtension;
use Symfony\Bridge\Twig\Extension\HttpKernelRuntime;
use Symfony\Component\HttpFoundation\Request;
@ -23,8 +22,6 @@ use Twig\Loader\ArrayLoader;
class HttpKernelExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
public function testFragmentWithError()
{
$this->expectException('Twig\Error\RuntimeError');

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\StopwatchExtension;
use Twig\Environment;
use Twig\Error\RuntimeError;
@ -20,8 +19,6 @@ use Twig\Loader\ArrayLoader;
class StopwatchExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
public function testFailIfStoppingWrongEvent()
{
$this->expectException('Twig\Error\SyntaxError');

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Component\Translation\Loader\ArrayLoader;
use Symfony\Component\Translation\Translator;
@ -21,8 +20,6 @@ use Twig\Loader\ArrayLoader as TwigArrayLoader;
class TranslationExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
public function testEscaping()
{
$output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(['value' => 12, 'msg' => 'approx.']);

View File

@ -13,7 +13,6 @@ namespace Symfony\Bridge\Twig\Tests\Extension;
use Fig\Link\Link;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\WebLinkExtension;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
@ -23,8 +22,6 @@ use Symfony\Component\HttpFoundation\RequestStack;
*/
class WebLinkExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var Request
*/
@ -35,7 +32,7 @@ class WebLinkExtensionTest extends TestCase
*/
private $extension;
private function doSetUp()
protected function setUp()
{
$this->request = new Request();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\WorkflowExtension;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Registry;
@ -22,11 +21,9 @@ use Symfony\Component\Workflow\Workflow;
class WorkflowExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
private $extension;
private function doSetUp()
protected function setUp()
{
$places = ['ordered', 'waiting_for_payment', 'processed'];
$transitions = [

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests\Translation;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Bridge\Twig\Translation\TwigExtractor;
use Symfony\Component\Translation\MessageCatalogue;
@ -22,8 +21,6 @@ use Twig\Loader\ArrayLoader;
class TwigExtractorTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @dataProvider getExtractData
*/

View File

@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\Templating\TemplateReference;
use Twig\Environment;
@ -20,8 +19,6 @@ use Twig\Loader\ArrayLoader;
class TwigEngineTest extends TestCase
{
use ForwardCompatTestTrait;
public function testExistsWithTemplateInstances()
{
$engine = $this->getTwig();

View File

@ -5,7 +5,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\CachedReader;
use Doctrine\Common\Annotations\Reader;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@ -16,11 +15,9 @@ use Symfony\Component\Filesystem\Filesystem;
class AnnotationsCacheWarmerTest extends TestCase
{
use ForwardCompatTestTrait;
private $cacheDir;
private function doSetUp()
protected function setUp()
{
$this->cacheDir = sys_get_temp_dir().'/'.uniqid();
$fs = new Filesystem();
@ -28,7 +25,7 @@ class AnnotationsCacheWarmerTest extends TestCase
parent::setUp();
}
private function doTearDown()
protected function tearDown()
{
$fs = new Filesystem();
$fs->remove($this->cacheDir);

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\SerializerCacheWarmer;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@ -23,8 +22,6 @@ use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
class SerializerCacheWarmerTest extends TestCase
{
use ForwardCompatTestTrait;
public function testWarmUp()
{
if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) {

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer;
use Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator;
@ -22,8 +21,6 @@ use Symfony\Component\Filesystem\Filesystem;
class TemplatePathsCacheWarmerTest extends TestCase
{
use ForwardCompatTestTrait;
/** @var Filesystem */
private $filesystem;
@ -38,7 +35,7 @@ class TemplatePathsCacheWarmerTest extends TestCase
private $tmpDir;
private function doSetUp()
protected function setUp()
{
$this->templateFinder = $this
->getMockBuilder(TemplateFinderInterface::class)
@ -59,7 +56,7 @@ class TemplatePathsCacheWarmerTest extends TestCase
$this->filesystem->mkdir($this->tmpDir);
}
private function doTearDown()
protected function tearDown()
{
$this->filesystem->remove($this->tmpDir);
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;
use PHPUnit\Framework\Warning;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@ -23,8 +22,6 @@ use Symfony\Component\Validator\ValidatorBuilder;
class ValidatorCacheWarmerTest extends TestCase
{
use ForwardCompatTestTrait;
public function testWarmUp()
{
if (\PHP_VERSION_ID >= 70400) {

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Command\CacheClearCommand;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Tests\Command\CacheClearCommand\Fixture\TestAppKernel;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@ -24,15 +23,13 @@ use Symfony\Component\Finder\Finder;
class CacheClearCommandTest extends TestCase
{
use ForwardCompatTestTrait;
/** @var TestAppKernel */
private $kernel;
/** @var Filesystem */
private $fs;
private $rootDir;
private function doSetUp()
protected function setUp()
{
$this->fs = new Filesystem();
$this->kernel = new TestAppKernel('test', true);
@ -41,7 +38,7 @@ class CacheClearCommandTest extends TestCase
$this->fs->mkdir($this->rootDir);
}
private function doTearDown()
protected function tearDown()
{
$this->fs->remove($this->rootDir);
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
@ -22,8 +21,6 @@ use Symfony\Component\Routing\RouteCollection;
class RouterDebugCommandTest extends TestCase
{
use ForwardCompatTestTrait;
public function testDebugAllRoutes()
{
$tester = $this->createCommandTester();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
@ -21,8 +20,6 @@ use Symfony\Component\HttpKernel;
class TranslationDebugCommandTest extends TestCase
{
use ForwardCompatTestTrait;
private $fs;
private $translationDir;
@ -110,7 +107,7 @@ class TranslationDebugCommandTest extends TestCase
$tester->execute(['locale' => 'en', 'bundle' => 'dir']);
}
private function doSetUp()
protected function setUp()
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
@ -120,7 +117,7 @@ class TranslationDebugCommandTest extends TestCase
$this->fs->mkdir($this->translationDir.'/templates');
}
private function doTearDown()
protected function tearDown()
{
$this->fs->remove($this->translationDir);
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
@ -21,8 +20,6 @@ use Symfony\Component\HttpKernel;
class TranslationUpdateCommandTest extends TestCase
{
use ForwardCompatTestTrait;
private $fs;
private $translationDir;
@ -90,7 +87,7 @@ class TranslationUpdateCommandTest extends TestCase
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
}
private function doSetUp()
protected function setUp()
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
@ -100,7 +97,7 @@ class TranslationUpdateCommandTest extends TestCase
$this->fs->mkdir($this->translationDir.'/templates');
}
private function doTearDown()
protected function tearDown()
{
$this->fs->remove($this->translationDir);
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Application as BaseApplication;
@ -29,8 +28,6 @@ use Symfony\Component\HttpKernel\KernelInterface;
*/
class YamlLintCommandTest extends TestCase
{
use ForwardCompatTestTrait;
private $files;
public function testLintCorrectFile()
@ -184,13 +181,13 @@ EOF;
return $application;
}
private function doSetUp()
protected function setUp()
{
@mkdir(sys_get_temp_dir().'/yml-lint-test');
$this->files = [];
}
private function doTearDown()
protected function tearDown()
{
foreach ($this->files as $file) {
if (file_exists($file)) {

View File

@ -11,19 +11,16 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor;
class TextDescriptorTest extends AbstractDescriptorTest
{
use ForwardCompatTestTrait;
private function doSetUp()
protected function setUp()
{
putenv('COLUMNS=121');
}
private function doTearDown()
protected function tearDown()
{
putenv('COLUMNS');
}

View File

@ -12,18 +12,15 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
use Composer\Autoload\ClassLoader;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\HttpKernel\Kernel;
class ControllerNameParserTest extends TestCase
{
use ForwardCompatTestTrait;
protected $loader;
private function doSetUp()
protected function setUp()
{
$this->loader = new ClassLoader();
$this->loader->add('TestBundle', __DIR__.'/../Fixtures');
@ -31,7 +28,7 @@ class ControllerNameParserTest extends TestCase
$this->loader->register();
}
private function doTearDown()
protected function tearDown()
{
$this->loader->unregister();
$this->loader = null;

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\DependencyInjection\Container;
@ -32,8 +31,6 @@ use Symfony\Component\Serializer\SerializerInterface;
abstract class ControllerTraitTest extends TestCase
{
use ForwardCompatTestTrait;
abstract protected function createController();
public function testForward()

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Controller\TemplateController;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@ -21,8 +20,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
*/
class TemplateControllerTest extends TestCase
{
use ForwardCompatTestTrait;
public function testTwig()
{
$twig = $this->getMockBuilder('Twig\Environment')->disableOriginalConstructor()->getMock();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -23,8 +22,6 @@ use Symfony\Component\DependencyInjection\Definition;
*/
class AddConsoleCommandPassTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @dataProvider visibilityProvider
*/

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConstraintValidatorsPass;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -25,8 +24,6 @@ use Symfony\Component\DependencyInjection\ServiceLocator;
*/
class AddConstraintValidatorsPassTest extends TestCase
{
use ForwardCompatTestTrait;
public function testThatConstraintValidatorServicesAreProcessed()
{
$container = new ContainerBuilder();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\DependencyInjection\ChildDefinition;
@ -22,11 +21,9 @@ use Symfony\Component\DependencyInjection\Reference;
class CachePoolPassTest extends TestCase
{
use ForwardCompatTestTrait;
private $cachePoolPass;
private function doSetUp()
protected function setUp()
{
$this->cachePoolPass = new CachePoolPass();
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPrunerPass;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
@ -22,8 +21,6 @@ use Symfony\Component\DependencyInjection\Reference;
class CachePoolPrunerPassTest extends TestCase
{
use ForwardCompatTestTrait;
public function testCompilerPassReplacesCommandArgument()
{
$container = new ContainerBuilder();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\DataCollectorTranslatorPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
@ -20,12 +19,10 @@ use Symfony\Component\Translation\TranslatorInterface;
class DataCollectorTranslatorPassTest extends TestCase
{
use ForwardCompatTestTrait;
private $container;
private $dataCollectorTranslatorPass;
private function doSetUp()
protected function setUp()
{
$this->container = new ContainerBuilder();
$this->dataCollectorTranslatorPass = new DataCollectorTranslatorPass();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
@ -25,8 +24,6 @@ use Symfony\Component\DependencyInjection\Reference;
*/
class FormPassTest extends TestCase
{
use ForwardCompatTestTrait;
public function testDoNothingIfFormExtensionNotLoaded()
{
$container = new ContainerBuilder();

View File

@ -12,14 +12,11 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ProfilerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class ProfilerPassTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* Tests that collectors that specify a template but no "id" will throw
* an exception (both are needed if the template is specified).

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
@ -26,8 +25,6 @@ use Symfony\Component\DependencyInjection\Reference;
*/
class SerializerPassTest extends TestCase
{
use ForwardCompatTestTrait;
public function testThrowExceptionWhenNoNormalizers()
{
$this->expectException('RuntimeException');

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\WorkflowGuardListenerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
@ -23,12 +22,10 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
class WorkflowGuardListenerPassTest extends TestCase
{
use ForwardCompatTestTrait;
private $container;
private $compilerPass;
private function doSetUp()
protected function setUp()
{
$this->container = new ContainerBuilder();
$this->compilerPass = new WorkflowGuardListenerPass();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration;
use Symfony\Bundle\FullStack;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
@ -21,8 +20,6 @@ use Symfony\Component\Lock\Store\SemaphoreStore;
class ConfigurationTest extends TestCase
{
use ForwardCompatTestTrait;
public function testDefaultConfig()
{
$processor = new Processor();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
use Doctrine\Common\Annotations\Annotation;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddAnnotationsCachedReaderPass;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@ -48,8 +47,6 @@ use Symfony\Component\Workflow\Registry;
abstract class FrameworkExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
private static $containerCache = [];
abstract protected function loadFromFile(ContainerBuilder $container, $file);

View File

@ -11,15 +11,12 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
class PhpFrameworkExtensionTest extends FrameworkExtensionTest
{
use ForwardCompatTestTrait;
protected function loadFromFile(ContainerBuilder $container, $file)
{
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php'));

View File

@ -11,26 +11,23 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\Filesystem\Filesystem;
abstract class AbstractWebTestCase extends BaseWebTestCase
{
use ForwardCompatTestTrait;
public static function assertRedirect($response, $location)
{
self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode());
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
static::deleteTmpDir();
}
private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
static::deleteTmpDir();
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
@ -21,9 +20,7 @@ use Symfony\Component\Console\Tester\CommandTester;
*/
class CachePoolClearCommandTest extends AbstractWebTestCase
{
use ForwardCompatTestTrait;
private function doSetUp()
protected function setUp()
{
static::bootKernel(['test_case' => 'CachePoolClear', 'root_config' => 'config.yml']);
}

View File

@ -11,15 +11,12 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\Adapter\AdapterInterface;
use Symfony\Component\Cache\Adapter\RedisAdapter;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
class CachePoolsTest extends AbstractWebTestCase
{
use ForwardCompatTestTrait;
public function testCachePools()
{
$this->doTestCachePools([], AdapterInterface::class);

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
@ -22,11 +21,9 @@ use Symfony\Component\Console\Tester\CommandTester;
*/
class ConfigDebugCommandTest extends AbstractWebTestCase
{
use ForwardCompatTestTrait;
private $application;
private function doSetUp()
protected function setUp()
{
$kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']);
$this->application = new Application($kernel);

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
@ -22,11 +21,9 @@ use Symfony\Component\Console\Tester\CommandTester;
*/
class ConfigDumpReferenceCommandTest extends AbstractWebTestCase
{
use ForwardCompatTestTrait;
private $application;
private function doSetUp()
protected function setUp()
{
$kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']);
$this->application = new Application($kernel);

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Routing;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Routing\Router;
use Symfony\Component\DependencyInjection\Config\ContainerParametersResource;
use Symfony\Component\Routing\Route;
@ -20,8 +19,6 @@ use Symfony\Component\Routing\RouteCollection;
class RouterTest extends TestCase
{
use ForwardCompatTestTrait;
public function testGenerateWithServiceParam()
{
$routes = new RouteCollection();

View File

@ -12,14 +12,11 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine;
use Symfony\Component\HttpFoundation\Response;
class DelegatingEngineTest extends TestCase
{
use ForwardCompatTestTrait;
public function testSupportsRetrievesEngineFromTheContainer()
{
$container = $this->getContainerMock([

View File

@ -11,19 +11,16 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\DependencyInjection\Container;
class GlobalVariablesTest extends TestCase
{
use ForwardCompatTestTrait;
private $container;
private $globals;
private function doSetUp()
protected function setUp()
{
$this->container = new Container();
$this->globals = new GlobalVariables($this->container);

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper;
use Symfony\Component\Asset\Package;
use Symfony\Component\Asset\Packages;
@ -20,11 +19,9 @@ use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
class AssetsHelperTest extends TestCase
{
use ForwardCompatTestTrait;
private $helper;
private function doSetUp()
protected function setUp()
{
$fooPackage = new Package(new StaticVersionStrategy('42', '%s?v=%s'));
$barPackage = new Package(new StaticVersionStrategy('22', '%s?%s'));

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper;
use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTranslator;
@ -23,8 +22,6 @@ use Symfony\Component\Templating\PhpEngine;
class FormHelperDivLayoutTest extends AbstractDivLayoutTest
{
use ForwardCompatTestTrait;
/**
* @var PhpEngine
*/
@ -55,7 +52,7 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
]);
}
private function doTearDown()
protected function tearDown()
{
$this->engine = null;

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper;
use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\Fixtures\StubTranslator;
@ -23,8 +22,6 @@ use Symfony\Component\Templating\PhpEngine;
class FormHelperTableLayoutTest extends AbstractTableLayoutTest
{
use ForwardCompatTestTrait;
/**
* @var PhpEngine
*/
@ -80,7 +77,7 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
]);
}
private function doTearDown()
protected function tearDown()
{
$this->engine = null;

View File

@ -12,18 +12,15 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
class RequestHelperTest extends TestCase
{
use ForwardCompatTestTrait;
protected $requestStack;
private function doSetUp()
protected function setUp()
{
$this->requestStack = new RequestStack();
$request = new Request();

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
@ -21,11 +20,9 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
class SessionHelperTest extends TestCase
{
use ForwardCompatTestTrait;
protected $requestStack;
private function doSetUp()
protected function setUp()
{
$request = new Request();
@ -39,7 +36,7 @@ class SessionHelperTest extends TestCase
$this->requestStack->push($request);
}
private function doTearDown()
protected function tearDown()
{
$this->requestStack = null;
}

View File

@ -11,15 +11,12 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Loader;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
class TemplateLocatorTest extends TestCase
{
use ForwardCompatTestTrait;
public function testLocateATemplate()
{
$template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine');

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
use Symfony\Bundle\FrameworkBundle\Templating\PhpEngine;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@ -24,8 +23,6 @@ use Symfony\Component\Templating\TemplateNameParser;
class PhpEngineTest extends TestCase
{
use ForwardCompatTestTrait;
public function testEvaluateAddsAppGlobal()
{
$container = $this->getContainer();

View File

@ -11,23 +11,20 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
class TemplateFilenameParserTest extends TestCase
{
use ForwardCompatTestTrait;
protected $parser;
private function doSetUp()
protected function setUp()
{
$this->parser = new TemplateFilenameParser();
}
private function doTearDown()
protected function tearDown()
{
$this->parser = null;
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@ -19,11 +18,9 @@ use Symfony\Component\Templating\TemplateReference as BaseTemplateReference;
class TemplateNameParserTest extends TestCase
{
use ForwardCompatTestTrait;
protected $parser;
private function doSetUp()
protected function setUp()
{
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
@ -40,7 +37,7 @@ class TemplateNameParserTest extends TestCase
$this->parser = new TemplateNameParser($kernel);
}
private function doTearDown()
protected function tearDown()
{
$this->parser = null;
}

View File

@ -13,7 +13,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Translation;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Translation\Translator;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Translation\Formatter\MessageFormatter;
@ -21,17 +20,15 @@ use Symfony\Component\Translation\MessageCatalogue;
class TranslatorTest extends TestCase
{
use ForwardCompatTestTrait;
protected $tmpDir;
private function doSetUp()
protected function setUp()
{
$this->tmpDir = sys_get_temp_dir().'/sf2_translation';
$this->deleteTmpDir();
}
private function doTearDown()
protected function tearDown()
{
$this->deleteTmpDir();
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Validator;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Validator\Constraint;
@ -24,8 +23,6 @@ use Symfony\Component\Validator\ConstraintValidator;
*/
class ConstraintValidatorFactoryTest extends TestCase
{
use ForwardCompatTestTrait;
public function testGetInstanceCreatesValidator()
{
$factory = new ConstraintValidatorFactory(new Container());

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSecurityVotersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\LogicException;
@ -22,8 +21,6 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class AddSecurityVotersPassTest extends TestCase
{
use ForwardCompatTestTrait;
public function testNoVoters()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\LogicException');

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
@ -23,8 +22,6 @@ use Symfony\Component\Security\Core\Encoder\Argon2iPasswordEncoder;
abstract class CompleteConfigurationTest extends TestCase
{
use ForwardCompatTestTrait;
abstract protected function getLoader(ContainerBuilder $container);
abstract protected function getFileExtension();

View File

@ -12,14 +12,11 @@
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration;
use Symfony\Component\Config\Definition\Processor;
class MainConfigurationTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* The minimal, required config needed to not have any required validation
* issues.

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\GuardAuthenticationFactory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
@ -21,8 +20,6 @@ use Symfony\Component\DependencyInjection\Reference;
class GuardAuthenticationFactoryTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @dataProvider getValidConfigurationTests
*/

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider\DummyProvider;
@ -20,8 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
class SecurityExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
public function testInvalidCheckPath()
{
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');

View File

@ -11,26 +11,23 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\Filesystem\Filesystem;
class AbstractWebTestCase extends BaseWebTestCase
{
use ForwardCompatTestTrait;
public static function assertRedirect($response, $location)
{
self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.substr($response, 0, 2000));
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
static::deleteTmpDir();
}
private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
static::deleteTmpDir();
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand;
use Symfony\Component\Console\Application as ConsoleApplication;
@ -28,8 +27,6 @@ use Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder;
*/
class UserPasswordEncoderCommandTest extends AbstractWebTestCase
{
use ForwardCompatTestTrait;
/** @var CommandTester */
private $passwordEncoderCommandTester;
@ -246,7 +243,7 @@ EOTXT
$this->assertContains('Encoder used Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder', $tester->getDisplay());
}
private function doSetUp()
protected function setUp()
{
putenv('COLUMNS='.(119 + \strlen(PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode']);
@ -259,7 +256,7 @@ EOTXT
$this->passwordEncoderCommandTester = new CommandTester($passwordEncoderCommand);
}
private function doTearDown()
protected function tearDown()
{
$this->passwordEncoderCommandTester = null;
}

View File

@ -12,15 +12,12 @@
namespace Symfony\Bundle\TwigBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\TwigLoaderPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
class TwigLoaderPassTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var ContainerBuilder
*/
@ -34,7 +31,7 @@ class TwigLoaderPassTest extends TestCase
*/
private $pass;
private function doSetUp()
protected function setUp()
{
$this->builder = new ContainerBuilder();
$this->builder->register('twig');

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\TwigBundle;
@ -21,8 +20,6 @@ use Symfony\Component\HttpKernel\Kernel;
class CacheWarmingTest extends TestCase
{
use ForwardCompatTestTrait;
public function testCacheIsProperlyWarmedWhenTemplatingIsAvailable()
{
$kernel = new CacheWarmingKernel(true);
@ -47,12 +44,12 @@ class CacheWarmingTest extends TestCase
$this->assertFileExists($kernel->getCacheDir().'/twig');
}
private function doSetUp()
protected function setUp()
{
$this->deleteTempDir();
}
private function doTearDown()
protected function tearDown()
{
$this->deleteTempDir();
}

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\TwigBundle;
@ -21,8 +20,6 @@ use Symfony\Component\HttpKernel\Kernel;
class NoTemplatingEntryTest extends TestCase
{
use ForwardCompatTestTrait;
public function test()
{
$kernel = new NoTemplatingEntryKernel('dev', true);
@ -33,12 +30,12 @@ class NoTemplatingEntryTest extends TestCase
$this->assertContains('{ a: b }', $content);
}
private function doSetUp()
protected function setUp()
{
$this->deleteTempDir();
}
private function doTearDown()
protected function tearDown()
{
$this->deleteTempDir();
}

View File

@ -11,15 +11,12 @@
namespace Symfony\Bundle\TwigBundle\Tests\Loader;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Bundle\TwigBundle\Loader\FilesystemLoader;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
class FilesystemLoaderTest extends TestCase
{
use ForwardCompatTestTrait;
public function testGetSourceContext()
{
$parser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\WebProfilerBundle\DependencyInjection\WebProfilerExtension;
use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;
use Symfony\Component\DependencyInjection\Container;
@ -23,8 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
class WebProfilerExtensionTest extends TestCase
{
use ForwardCompatTestTrait;
private $kernel;
/**
* @var \Symfony\Component\DependencyInjection\Container
@ -49,7 +46,7 @@ class WebProfilerExtensionTest extends TestCase
self::assertEquals([], $errors, $message);
}
private function doSetUp()
protected function setUp()
{
parent::setUp();
@ -76,7 +73,7 @@ class WebProfilerExtensionTest extends TestCase
$this->container->addCompilerPass(new RegisterListenersPass());
}
private function doTearDown()
protected function tearDown()
{
parent::tearDown();

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\WebProfilerBundle\Tests\Profiler;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager;
use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;
use Symfony\Component\HttpKernel\Profiler\Profile;
@ -24,8 +23,6 @@ use Twig\Environment;
*/
class TemplateManagerTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @var Environment
*/
@ -41,7 +38,7 @@ class TemplateManagerTest extends TestCase
*/
protected $templateManager;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -12,15 +12,12 @@
namespace Symfony\Component\Asset\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Asset\Package;
use Symfony\Component\Asset\Packages;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
class PackagesTest extends TestCase
{
use ForwardCompatTestTrait;
public function testGetterSetters()
{
$packages = new Packages();

View File

@ -12,15 +12,12 @@
namespace Symfony\Component\Asset\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Asset\UrlPackage;
use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
class UrlPackageTest extends TestCase
{
use ForwardCompatTestTrait;
/**
* @dataProvider getConfigs
*/

View File

@ -12,13 +12,10 @@
namespace Symfony\Component\Asset\Tests\VersionStrategy;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy;
class JsonManifestVersionStrategyTest extends TestCase
{
use ForwardCompatTestTrait;
public function testGetVersion()
{
$strategy = $this->createStrategy('manifest-valid.json');

View File

@ -12,13 +12,10 @@
namespace Symfony\Component\BrowserKit\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\BrowserKit\Cookie;
class CookieTest extends TestCase
{
use ForwardCompatTestTrait;
public function testToString()
{
$cookie = new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true);

View File

@ -11,13 +11,10 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\Adapter\RedisAdapter;
abstract class AbstractRedisAdapterTest extends AdapterTestCase
{
use ForwardCompatTestTrait;
protected $skippedTests = [
'testExpiration' => 'Testing expiration slows down the test suite',
'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite',
@ -31,7 +28,7 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase
return new RedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifetime);
}
private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
if (!\extension_loaded('redis')) {
self::markTestSkipped('Extension redis required.');
@ -42,7 +39,7 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase
}
}
private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
self::$redis = null;
}

View File

@ -13,14 +13,11 @@ namespace Symfony\Component\Cache\Tests\Adapter;
use Cache\IntegrationTests\CachePoolTest;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\PruneableInterface;
abstract class AdapterTestCase extends CachePoolTest
{
use ForwardCompatTestTrait;
private function doSetUp()
protected function setUp()
{
parent::setUp();

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\Adapter\AdapterInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Adapter\ChainAdapter;
@ -25,8 +24,6 @@ use Symfony\Component\Cache\Tests\Fixtures\ExternalAdapter;
*/
class ChainAdapterTest extends AdapterTestCase
{
use ForwardCompatTestTrait;
public function createCachePool($defaultLifetime = 0)
{
return new ChainAdapter([new ArrayAdapter($defaultLifetime), new ExternalAdapter(), new FilesystemAdapter('', $defaultLifetime)], $defaultLifetime);

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
/**
@ -20,14 +19,12 @@ use Symfony\Component\Cache\Adapter\FilesystemAdapter;
*/
class FilesystemAdapterTest extends AdapterTestCase
{
use ForwardCompatTestTrait;
public function createCachePool($defaultLifetime = 0)
{
return new FilesystemAdapter('', $defaultLifetime);
}
private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
self::rmdir(sys_get_temp_dir().'/symfony-cache');
}

View File

@ -12,13 +12,10 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
class MaxIdLengthAdapterTest extends TestCase
{
use ForwardCompatTestTrait;
public function testLongKey()
{
$cache = $this->getMockBuilder(MaxIdLengthAdapter::class)

Some files were not shown because too many files have changed in this diff Show More