Skip to content

Commit

Permalink
Merge pull request #935 from dreamsxin/OPERATORS
Browse files Browse the repository at this point in the history
Fix bug about GreaterEqualOperator
  • Loading branch information
ovr committed May 4, 2015
2 parents b0412a0 + 947f2e4 commit 09e3ac3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Operators/Comparison/GreaterEqualOperator.php
Expand Up @@ -30,5 +30,5 @@ class GreaterEqualOperator extends ComparisonBaseOperator

protected $_zvalLongOperator = 'ZEPHIR_GE_LONG';

protected $_zvalLongNegOperator = 'ZEPHIR_LT_LONG';
protected $_zvalLongNegOperator = 'ZEPHIR_LE_LONG';
}
5 changes: 5 additions & 0 deletions test/compare.zep
Expand Up @@ -9,6 +9,11 @@ class Compare
return a < b;
}

public function isGreaterEqual(int a, int b)
{
return a >= b;
}

public function isLessDouble(double a, double b)
{
return a < b;
Expand Down
9 changes: 9 additions & 0 deletions unit-tests/Extension/CompareTest.php
Expand Up @@ -32,6 +32,15 @@ public function testLess()
$this->assertFalse($t->isLessInt(20, 10));
}

public function testGreaterEqual()
{
$t = new Compare;

$this->assertTrue($t->isGreaterEqual(3, 2));
$this->assertTrue($t->isGreaterEqual(2, 2));
$this->assertFalse($t->isGreaterEqual(1, 2));
}

public function testConst()
{
$t = new Compare;
Expand Down

0 comments on commit 09e3ac3

Please sign in to comment.