Skip to content

Commit 5fc4b5c

Browse files
Merge branch '2.7' into 2.8
* 2.7: Further refactorings to PHPUnit namespaces resolve parameters in definition classes
2 parents 8ea05b6 + d8633c6 commit 5fc4b5c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Tests/FinderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,10 @@ public function testAccessDeniedException()
699699
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, 'PHPUnit_Framework_ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
700700
}
701701

702+
if ($e instanceof \PHPUnit\Framework\ExpectationFailedException) {
703+
$this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, '\PHPUnit\Framework\ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
704+
}
705+
702706
$this->assertInstanceOf($expectedExceptionClass, $e);
703707
}
704708
}

Tests/Shell/CommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testInsDuplicateLabelException()
106106
$cmd = Command::create()->add('--force');
107107

108108
$cmd->ins('label');
109-
$this->setExpectedException('RuntimeException');
109+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
110110
$cmd->ins('label');
111111
}
112112

@@ -122,15 +122,15 @@ public function testEndNoParentException()
122122
{
123123
$cmd = Command::create();
124124

125-
$this->setExpectedException('RuntimeException');
125+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
126126
$cmd->end();
127127
}
128128

129129
public function testGetMissingLabelException()
130130
{
131131
$cmd = Command::create();
132132

133-
$this->setExpectedException('RuntimeException');
133+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('RuntimeException');
134134
$cmd->get('invalid');
135135
}
136136

0 commit comments

Comments
 (0)