Skip to content

Commit 12f4323

Browse files
committed
Remove dead code about old phpunit version
Change-Id: I0278aada66e4661c05381efa26d80e22c4205a41
1 parent d1ba762 commit 12f4323

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

tests/Reader/DBATest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ protected function setUp() : void {
1818
}
1919

2020
public function testConstructor() {
21-
if ( is_callable( [ $this, 'setExpectedException' ] ) ) {
22-
// PHPUnit 4.8
23-
$this->setExpectedException( Exception::class );
24-
} else {
25-
// PHPUnit 6+
26-
$this->expectException( Exception::class );
27-
}
21+
$this->expectException( Exception::class );
2822
// Silence native error from dba_open()
2923
// @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors
3024
@new DBA( '/tmp/non-exist' );

tests/Reader/HashTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99
class HashTest extends \PHPUnit\Framework\TestCase {
1010

1111
public function testConstructor_fail() {
12-
if ( is_callable( [ $this, 'setExpectedException' ] ) ) {
13-
// PHPUnit 4.8
14-
$this->setExpectedException( \InvalidArgumentException::class );
15-
} else {
16-
// PHPUnit 6+
17-
$this->expectException( \InvalidArgumentException::class );
18-
}
12+
$this->expectException( \InvalidArgumentException::class );
1913
new Hash( 'not an array' );
2014
}
2115

tests/Reader/PHPTest.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,15 @@ protected function tearDown() : void {
2727

2828
// File can't be opened
2929
public function testConstructorOpen() {
30-
if ( is_callable( [ $this, 'setExpectedException' ] ) ) {
31-
// PHPUnit 4.8
32-
$this->setExpectedException( Exception::class );
33-
} else {
34-
// PHPUnit 6+
35-
$this->expectException( Exception::class );
36-
}
30+
$this->expectException( Exception::class );
3731
// Ignore native error from fopen()
3832
// @codingStandardsIgnoreLine Generic.PHP.NoSilencedErrors
3933
@new PHP( '/tmp/non-exist' );
4034
}
4135

4236
// File contains fewer than 2048 bytes
4337
public function testConstructorRead() {
44-
if ( is_callable( [ $this, 'setExpectedException' ] ) ) {
45-
// PHPUnit 4.8
46-
$this->setExpectedException( Exception::class );
47-
} else {
48-
// PHPUnit 6+
49-
$this->expectException( Exception::class );
50-
}
38+
$this->expectException( Exception::class );
5139
new PHP( $this->cdbFile );
5240
}
5341
}

0 commit comments

Comments
 (0)