Skip to content

Commit

Permalink
[Tests] Add more debug on failure for methodCallCountConstraint added…
Browse files Browse the repository at this point in the history
… in #75
  • Loading branch information
andrerom committed Apr 30, 2019
1 parent 2240dda commit bb3204c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tests/lib/FieldType/Converter/MethodCallCountConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,18 @@ public function toString()
*
* @throws PHPUnit_Framework_ExpectationFailedException
*/
public function verify()
public function verify($test = null)
{
$count = $this->getInvocationCount();
if ($count != $this->expectedCount) {
throw new PHPUnit_Framework_ExpectationFailedException(
throw new ExpectationFailedException(
sprintf(
'Methods of class was expected to be called %d times, ' .
'actually called %d times.',
'actually called %d times.' . ($test ? "\nWhile testing '%s'." : ''),

$this->expectedCount,
$count
$count,
$test
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/FieldType/Converter/RichTextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function testConvert($inputFilePath, $outputFilePath, $logFilePath)
$richText->setImageContentTypes([27]);

$result = $richText->convert($inputDocument, true, true);
$this->methodCallCountConstraint->verify();
$this->methodCallCountConstraint->verify(basename($inputFilePath));

if ($result === false && !file_exists($outputFilePath)) {
return;
Expand Down

0 comments on commit bb3204c

Please sign in to comment.