Skip to content

Commit

Permalink
Dev: Even more 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 4c1b53d commit 127e99a
Showing 1 changed file with 123 additions and 10 deletions.
133 changes: 123 additions & 10 deletions tests/helpers/ExpressionCoreHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPUnit\Framework\TestCase;

/**
* Test expression evaluation in PHP vs JS.
* @since 2017-06-16
* @group em
*/
Expand Down Expand Up @@ -64,31 +65,146 @@ public function notes()
}

/**
* Expression: '' >= ''
* Expression: '' == ' '
*/
public function testCompareEmptyNumberAndEmptyString()
public function testCompareEmptyEqSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK == " "))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

$expression = '((563168X136X5376.NAOK >= ""))';
/**
* Expression: '0' == ' '
*/
public function testCompareZeroEqSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK == " "))';
$value = '0';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '' != ' '
*/
public function testCompareEmptyNeSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK != " "))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '3' != ' '
*/
public function testCompareNumberNeSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK != " "))';
$value = '3';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '3' != ''
*/
public function testCompareNumberNeEmpty()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK != ""))';
$value = '3';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '' >= ' '
* Expression: '' != ''
*/
public function testCompareEmptyNumberAndSpace()
public function testCompareEmptyNeEmpty()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK != ""))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

$expression = '((563168X136X5376.NAOK >= " "))';
/**
* Expression: '' < ' '
*/
public function testCompareEmptyLtSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK < " "))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '3' < ' '
*/
public function testCompareNumberLtSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK < " "))';
$value = '3';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '' > ' '
*/
public function testCompareEmptyGtSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK > " "))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '3' > ' '
*/
public function testCompareNumberGtSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK > " "))';
$value = '3';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: ' ' > ' '
*/
public function testCompareSpaceGtSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK > " "))';
$value = ' ';
$this->compareExpression($sgqa, $value, $expression);
}

/**
* Expression: '' >= ''
*/
public function testCompareEmptyGeEmpty()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK >= ""))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}


/**
* Expression: '' >= ' '
*/
public function testCompareEmptyGeSpace()
{
$sgqa = '563168X136X5376';
$expression = '((563168X136X5376.NAOK >= " "))';
$value = '';
$this->compareExpression($sgqa, $value, $expression);
}

Expand All @@ -97,14 +213,11 @@ public function testCompareEmptyNumberAndSpace()
* as "No answer".
* Expression: '3' >= ' '
*/
public function testCompareNumberAndEmptyString()
public function testCompareNumberGeSpace()
{
$sgqa = '563168X136X5376';

$expression = '((563168X136X5376.NAOK >= " "))';

$value = '3';

$this->compareExpression($sgqa, $value, $expression);
}

Expand Down

0 comments on commit 127e99a

Please sign in to comment.