Skip to content

Commit

Permalink
minor #33055 [FrameworkBundle][TwigBridge] Fix test compatibility wit…
Browse files Browse the repository at this point in the history
…h 4.x components (jderusse)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][TwigBridge] Fix test compatibility with 4.x components

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | NA
| License       | MIT
| Doc PR        | NA

our symfony Tests extends other component's tests. By being compatible with symfony 4.x we now extends class that have return type signature which is not doable in branch 3.4 because of support of php 5.5. (see https://travis-ci.org/symfony/symfony/jobs/569345176)

This PR replaces setup and teardown by `@after` and `@before` annotation in order to keep the same behavior and compatibility

Commits
-------

bb3cb64 Fix test compatibility with 4.x components
  • Loading branch information
nicolas-grekas committed Aug 8, 2019
2 parents e95b8a3 + bb3cb64 commit 889f454
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
Expand Up @@ -33,10 +33,11 @@ class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3Hori
*/
private $renderer;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -29,10 +29,11 @@ class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
*/
private $renderer;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -35,10 +35,11 @@ class FormExtensionBootstrap4HorizontalLayoutTest extends AbstractBootstrap4Hori

private $renderer;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -33,10 +33,11 @@ class FormExtensionBootstrap4LayoutTest extends AbstractBootstrap4LayoutTest
*/
private $renderer;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -33,10 +33,11 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest

protected static $supportedFeatureSetVersion = 304;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -32,10 +32,11 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest

protected static $supportedFeatureSetVersion = 304;

protected function setUp()
/**
* @before
*/
public function doSetUp()
{
parent::setUp();

$loader = new StubFilesystemLoader([
__DIR__.'/../../Resources/views/Form',
__DIR__.'/Fixtures/templates/form',
Expand Down
Expand Up @@ -52,11 +52,12 @@ protected function getExtensions()
]);
}

protected function tearDown()
/**
* @after
*/
public function doTearDown()
{
$this->engine = null;

parent::tearDown();
}

public function testStartTagHasNoActionAttributeWhenActionIsEmpty()
Expand Down
Expand Up @@ -77,11 +77,12 @@ protected function getExtensions()
]);
}

protected function tearDown()
/**
* @after
*/
public function doTearDown()
{
$this->engine = null;

parent::tearDown();
}

protected function renderForm(FormView $view, array $vars = [])
Expand Down

0 comments on commit 889f454

Please sign in to comment.