Skip to content

Commit

Permalink
Merge branch '4.4'
Browse files Browse the repository at this point in the history
* 4.4:
  cs fix
  Replace calls to setExpectedException by Pollyfill
  • Loading branch information
nicolas-grekas committed Aug 1, 2019
2 parents 201c0e9 + 470c359 commit 6100726
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Tests/Catalogue/AbstractOperationTest.php
Expand Up @@ -12,11 +12,14 @@
namespace Symfony\Component\Translation\Tests\Catalogue;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\MessageCatalogueInterface;

abstract class AbstractOperationTest extends TestCase
{
use ForwardCompatTestTrait;

public function testGetEmptyDomains()
{
$this->assertEquals(
Expand Down
11 changes: 5 additions & 6 deletions Tests/Loader/QtFileLoaderTest.php
Expand Up @@ -12,11 +12,14 @@
namespace Symfony\Component\Translation\Tests\Loader;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Translation\Loader\QtFileLoader;

class QtFileLoaderTest extends TestCase
{
use ForwardCompatTestTrait;

public function testLoad()
{
$loader = new QtFileLoader();
Expand Down Expand Up @@ -67,12 +70,8 @@ public function testLoadEmptyResource()
$loader = new QtFileLoader();
$resource = __DIR__.'/../fixtures/empty.xlf';

if (method_exists($this, 'expectException')) {
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
$this->expectExceptionMessage(sprintf('Unable to load "%s".', $resource));
} else {
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s".', $resource));
}
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
$this->expectExceptionMessage(sprintf('Unable to load "%s".', $resource));

$loader->load($resource, 'en', 'domain1');
}
Expand Down
11 changes: 5 additions & 6 deletions Tests/Loader/XliffFileLoaderTest.php
Expand Up @@ -12,11 +12,14 @@
namespace Symfony\Component\Translation\Tests\Loader;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Translation\Loader\XliffFileLoader;

class XliffFileLoaderTest extends TestCase
{
use ForwardCompatTestTrait;

public function testLoad()
{
$loader = new XliffFileLoader();
Expand Down Expand Up @@ -159,12 +162,8 @@ public function testParseEmptyFile()
$loader = new XliffFileLoader();
$resource = __DIR__.'/../fixtures/empty.xlf';

if (method_exists($this, 'expectException')) {
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
$this->expectExceptionMessage(sprintf('Unable to load "%s":', $resource));
} else {
$this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s":', $resource));
}
$this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException');
$this->expectExceptionMessage(sprintf('Unable to load "%s":', $resource));

$loader->load($resource, 'en', 'domain1');
}
Expand Down

0 comments on commit 6100726

Please sign in to comment.