Skip to content

Commit

Permalink
Merge branch '4.3' into 4.4
Browse files Browse the repository at this point in the history
* 4.3:
  Remove use of ForwardCompatTrait
  Remove deprecated methods assertArraySubset
  • Loading branch information
nicolas-grekas committed Aug 3, 2019
2 parents f08cb83 + 4615d1b commit a3d46b2
Show file tree
Hide file tree
Showing 33 changed files with 38 additions and 137 deletions.
5 changes: 1 addition & 4 deletions Tests/BinaryFileResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\HttpFoundation\Tests;

use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\File\Stream;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -20,8 +19,6 @@

class BinaryFileResponseTest extends ResponseTestCase
{
use ForwardCompatTestTrait;

public function testConstruction()
{
$file = __DIR__.'/../README.md';
Expand Down Expand Up @@ -358,7 +355,7 @@ protected function provideResponse()
return new BinaryFileResponse(__DIR__.'/../README.md', 200, ['Content-Type' => 'application/octet-stream']);
}

private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
$path = __DIR__.'/../Fixtures/to_delete';
if (file_exists($path)) {
Expand Down
3 changes: 0 additions & 3 deletions Tests/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Cookie;

/**
Expand All @@ -25,8 +24,6 @@
*/
class CookieTest extends TestCase
{
use ForwardCompatTestTrait;

public function invalidNames()
{
return [
Expand Down
3 changes: 0 additions & 3 deletions Tests/ExpressionRequestMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\HttpFoundation\ExpressionRequestMatcher;
use Symfony\Component\HttpFoundation\Request;

class ExpressionRequestMatcherTest extends TestCase
{
use ForwardCompatTestTrait;

public function testWhenNoExpressionIsSet()
{
$this->expectException('LogicException');
Expand Down
3 changes: 0 additions & 3 deletions Tests/File/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
namespace Symfony\Component\HttpFoundation\Tests\File;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\File\File;

/**
* @requires extension fileinfo
*/
class FileTest extends TestCase
{
use ForwardCompatTestTrait;

protected $file;

public function testGetMimeTypeUsesMimeTypeGuessers()
Expand Down
5 changes: 1 addition & 4 deletions Tests/File/MimeType/MimeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests\File\MimeType;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;

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

public function testGuessImageWithoutExtension()
{
$this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test'));
Expand Down Expand Up @@ -81,7 +78,7 @@ public function testGuessWithNonReadablePath()
}
}

private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
$path = __DIR__.'/../Fixtures/to_delete';
if (file_exists($path)) {
Expand Down
5 changes: 1 addition & 4 deletions Tests/File/UploadedFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests\File;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException;
use Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
Expand All @@ -25,9 +24,7 @@

class UploadedFileTest extends TestCase
{
use ForwardCompatTestTrait;

private function doSetUp()
protected function setUp()
{
if (!ini_get('file_uploads')) {
$this->markTestSkipped('file_uploads is disabled in php.ini');
Expand Down
7 changes: 2 additions & 5 deletions Tests/FileBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\FileBag;

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

public function testFileMustBeAnArrayOrUploadedFile()
{
$this->expectException('InvalidArgumentException');
Expand Down Expand Up @@ -163,12 +160,12 @@ protected function createTempFile()
return $tempFile;
}

private function doSetUp()
protected function setUp()
{
mkdir(sys_get_temp_dir().'/form_test', 0777, true);
}

private function doTearDown()
protected function tearDown()
{
foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) {
unlink($file);
Expand Down
3 changes: 0 additions & 3 deletions Tests/HeaderBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\HeaderBag;

class HeaderBagTest extends TestCase
{
use ForwardCompatTestTrait;

public function testConstructor()
{
$bag = new HeaderBag(['foo' => 'bar']);
Expand Down
3 changes: 0 additions & 3 deletions Tests/IpUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\IpUtils;

class IpUtilsTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @dataProvider getIpv4Data
*/
Expand Down
3 changes: 0 additions & 3 deletions Tests/JsonResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\JsonResponse;

class JsonResponseTest extends TestCase
{
use ForwardCompatTestTrait;

public function testConstructorEmptyCreatesJsonObject()
{
$response = new JsonResponse();
Expand Down
3 changes: 0 additions & 3 deletions Tests/RedirectResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\RedirectResponse;

class RedirectResponseTest extends TestCase
{
use ForwardCompatTestTrait;

public function testGenerateMetaRedirect()
{
$response = new RedirectResponse('foo.bar');
Expand Down
5 changes: 1 addition & 4 deletions Tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;

class RequestTest extends TestCase
{
use ForwardCompatTestTrait;

private function doTearDown()
protected function tearDown()
{
Request::setTrustedProxies([], -1);
Request::setTrustedHosts([]);
Expand Down
7 changes: 2 additions & 5 deletions Tests/ResponseFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@
namespace Symfony\Component\HttpFoundation\Tests;

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

/**
* @requires PHP 7.0
*/
class ResponseFunctionalTest extends TestCase
{
use ForwardCompatTestTrait;

private static $server;

private static function doSetUpBeforeClass()
public static function setUpBeforeClass()
{
$spec = [
1 => ['file', '/dev/null', 'w'],
Expand All @@ -35,7 +32,7 @@ private static function doSetUpBeforeClass()
sleep(1);
}

private static function doTearDownAfterClass()
public static function tearDownAfterClass()
{
if (self::$server) {
proc_terminate(self::$server);
Expand Down
3 changes: 0 additions & 3 deletions Tests/ResponseHeaderBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;

Expand All @@ -21,8 +20,6 @@
*/
class ResponseHeaderBagTest extends TestCase
{
use ForwardCompatTestTrait;

public function testAllPreserveCase()
{
$headers = [
Expand Down
3 changes: 0 additions & 3 deletions Tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\HttpFoundation\Tests;

use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -21,8 +20,6 @@
*/
class ResponseTest extends ResponseTestCase
{
use ForwardCompatTestTrait;

public function testCreate()
{
$response = Response::create('foo', 301, ['Foo' => 'bar']);
Expand Down
7 changes: 2 additions & 5 deletions Tests/Session/Attribute/AttributeBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests\Session\Attribute;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;

/**
Expand All @@ -22,16 +21,14 @@
*/
class AttributeBagTest extends TestCase
{
use ForwardCompatTestTrait;

private $array = [];

/**
* @var AttributeBag
*/
private $bag;

private function doSetUp()
protected function setUp()
{
$this->array = [
'hello' => 'world',
Expand All @@ -52,7 +49,7 @@ private function doSetUp()
$this->bag->initialize($this->array);
}

private function doTearDown()
protected function tearDown()
{
$this->bag = null;
$this->array = [];
Expand Down
7 changes: 2 additions & 5 deletions Tests/Session/Attribute/NamespacedAttributeBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests\Session\Attribute;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;

/**
Expand All @@ -22,16 +21,14 @@
*/
class NamespacedAttributeBagTest extends TestCase
{
use ForwardCompatTestTrait;

private $array = [];

/**
* @var NamespacedAttributeBag
*/
private $bag;

private function doSetUp()
protected function setUp()
{
$this->array = [
'hello' => 'world',
Expand All @@ -52,7 +49,7 @@ private function doSetUp()
$this->bag->initialize($this->array);
}

private function doTearDown()
protected function tearDown()
{
$this->bag = null;
$this->array = [];
Expand Down
7 changes: 2 additions & 5 deletions Tests/Session/Flash/AutoExpireFlashBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Tests\Session\Flash;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag as FlashBag;

/**
Expand All @@ -22,24 +21,22 @@
*/
class AutoExpireFlashBagTest extends TestCase
{
use ForwardCompatTestTrait;

/**
* @var \Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag
*/
private $bag;

protected $array = [];

private function doSetUp()
protected function setUp()
{
parent::setUp();
$this->bag = new FlashBag();
$this->array = ['new' => ['notice' => ['A previous flash message']]];
$this->bag->initialize($this->array);
}

private function doTearDown()
protected function tearDown()
{
$this->bag = null;
parent::tearDown();
Expand Down
Loading

0 comments on commit a3d46b2

Please sign in to comment.