Skip to content

Commit 6493779

Browse files
committed
simplified PHPUnit exception expectations
1 parent 410ec9f commit 6493779

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/Command/CommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function testGetSetAliases()
188188
public function testSetAliasesNull()
189189
{
190190
$command = new \TestCommand();
191-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
191+
$this->expectException('InvalidArgumentException');
192192
$command->setAliases(null);
193193
}
194194

Tests/Formatter/OutputFormatterStyleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testForeground()
4141
$style->setForeground('default');
4242
$this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo'));
4343

44-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
44+
$this->expectException('InvalidArgumentException');
4545
$style->setForeground('undefined-color');
4646
}
4747

@@ -58,7 +58,7 @@ public function testBackground()
5858
$style->setBackground('default');
5959
$this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo'));
6060

61-
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
61+
$this->expectException('InvalidArgumentException');
6262
$style->setBackground('undefined-color');
6363
}
6464

0 commit comments

Comments
 (0)