Skip to content

Commit

Permalink
Dev: Better output from EM tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt authored and LouisGac committed Aug 28, 2017
1 parent 52329c9 commit ad4cc94
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/helpers/ExpressionCoreHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public function testCompareNumberLtSpace()

/**
* Expression: '3' < 'A'
* @group me
*/
public function testCompareNumberLtLetter()
{
Expand Down Expand Up @@ -317,10 +316,10 @@ protected function compareExpression($sgqa, $value, $expression, $jsonEncode = t

$em->RDP_Evaluate($expression);

$result = $em->GetResult();
$emResult = $em->GetResult();

if ($jsonEncode) {
$result = json_encode($result);
$emResult = json_encode($emResult);
}

$errors = $em->RDP_GetErrors();
Expand All @@ -332,7 +331,15 @@ protected function compareExpression($sgqa, $value, $expression, $jsonEncode = t
$nodeOutput = $this->runNode($js);

$this->assertCount(1, $nodeOutput);
$this->assertEquals($result, $nodeOutput[0], 'JS and PHP must return same result: ' . $expression);
$this->assertEquals(
$emResult,
$nodeOutput[0],
sprintf(
'JS (%s) and PHP (%s) must return same result. Expression: ' . $expression,
$nodeOutput[0],
$emResult
)
);
}

/**
Expand Down

0 comments on commit ad4cc94

Please sign in to comment.