File tree Expand file tree Collapse file tree 3 files changed +4
-28
lines changed
Expand file tree Collapse file tree 3 files changed +4
-28
lines changed Original file line number Diff line number Diff 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 ' );
Original file line number Diff line number Diff line change 99class 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
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments