2013-11-30 17:17:18 -08:00
|
|
|
<?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");
|
2013-12-10 01:06:21 +01:00
|
|
|
$this->assertEquals("b", $result);
|
2013-11-30 17:17:18 -08:00
|
|
|
}
|
|
|
|
|
public function testFailure()
|
|
|
|
|
{
|
|
|
|
|
$result = h_parse($this->parser, "d");
|
|
|
|
|
$this->assertEquals(NULL, $result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|