Skip to content

Commit 58cf06e

Browse files
Merge branch '4.4'
* 4.4: cs fix Replace calls to setExpectedException by Pollyfill
2 parents 9c2b828 + edbc69f commit 58cf06e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Legacy/ForwardCompatTestTraitForV7.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ protected function createMock($originalClassName): MockObject
3030
->disableOriginalClone()
3131
->disableArgumentCloning()
3232
->disallowMockingUnknownTypes()
33-
->getMock();
33+
->getMock();
3434
}
3535
}

Tests/ProcessIsolationTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Symfony\Bridge\PhpUnit\Tests;
44

55
use PHPUnit\Framework\TestCase;
6+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
67

78
/**
89
* Don't remove this test case, it tests the legacy group.
@@ -13,6 +14,8 @@
1314
*/
1415
class ProcessIsolationTest extends TestCase
1516
{
17+
use ForwardCompatTestTrait;
18+
1619
/**
1720
* @expectedDeprecation Test abc
1821
*/
@@ -25,12 +28,8 @@ public function testIsolation()
2528
public function testCallingOtherErrorHandler()
2629
{
2730
$class = class_exists('PHPUnit\Framework\Exception') ? 'PHPUnit\Framework\Exception' : 'PHPUnit_Framework_Exception';
28-
if (method_exists($this, 'expectException')) {
29-
$this->expectException($class);
30-
$this->expectExceptionMessage('Test that PHPUnit\'s error handler fires.');
31-
} else {
32-
$this->setExpectedException($class, 'Test that PHPUnit\'s error handler fires.');
33-
}
31+
$this->expectException($class);
32+
$this->expectExceptionMessage('Test that PHPUnit\'s error handler fires.');
3433

3534
trigger_error('Test that PHPUnit\'s error handler fires.', E_USER_WARNING);
3635
}

0 commit comments

Comments
 (0)