diff --git a/src/bindings/php/Tests/InTest.php b/src/bindings/php/Tests/InTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5c2ed8c4f1db53b514f765faa96f70a9fbfa853a --- /dev/null +++ b/src/bindings/php/Tests/InTest.php @@ -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); + } +} +?> \ No newline at end of file diff --git a/src/bindings/php/Tests/NotInTest.php b/src/bindings/php/Tests/NotInTest.php new file mode 100644 index 0000000000000000000000000000000000000000..44a12a784670436a14c86e4204ba58a99d22ac4f --- /dev/null +++ b/src/bindings/php/Tests/NotInTest.php @@ -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); + } +} +?> \ No newline at end of file