h_in and h_not_in also have a wrong param count issue
This commit is contained in:
parent
ce5a621ee3
commit
48d6cf6f88
2 changed files with 48 additions and 0 deletions
24
src/bindings/php/Tests/InTest.php
Normal file
24
src/bindings/php/Tests/InTest.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
include_once 'hammer.php';
|
||||||
|
|
||||||
|
class InTest extends PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
protected $parser;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
$this->parser = h_in("abc");
|
||||||
|
}
|
||||||
|
public function testSuccess()
|
||||||
|
{
|
||||||
|
$result = h_parse($this->parser, "b");
|
||||||
|
// TODO: fixme when h_ch is fixed
|
||||||
|
$this->assertEquals(98, $result);
|
||||||
|
}
|
||||||
|
public function testFailure()
|
||||||
|
{
|
||||||
|
$result = h_parse($this->parser, "d");
|
||||||
|
$this->assertEquals(NULL, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
24
src/bindings/php/Tests/NotInTest.php
Normal file
24
src/bindings/php/Tests/NotInTest.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
include_once 'hammer.php';
|
||||||
|
|
||||||
|
class NotInTest extends PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
protected $parser;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
$this->parser = h_not_in("abc");
|
||||||
|
}
|
||||||
|
public function testSuccess()
|
||||||
|
{
|
||||||
|
$result = h_parse($this->parser, "d");
|
||||||
|
// TODO: fixme when h_ch is fixed
|
||||||
|
$this->assertEquals(100, $result);
|
||||||
|
}
|
||||||
|
public function testFailure()
|
||||||
|
{
|
||||||
|
$result = h_parse($this->parser, "b");
|
||||||
|
$this->assertEquals(NULL, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue