2013-11-20 02:13:41 -06:00
|
|
|
<?php
|
|
|
|
|
|
2013-11-24 19:26:14 -06:00
|
|
|
include_once 'hammer.php';
|
2013-11-20 02:13:41 -06:00
|
|
|
|
2013-11-20 20:24:21 -06:00
|
|
|
class TokenTest extends PHPUnit_Framework_TestCase
|
2013-11-20 02:13:41 -06:00
|
|
|
{
|
|
|
|
|
protected $parser;
|
|
|
|
|
|
|
|
|
|
protected function setUp()
|
|
|
|
|
{
|
2013-11-24 20:12:54 -06:00
|
|
|
$this->parser = h_token("95\xa2");
|
2013-11-20 02:13:41 -06:00
|
|
|
}
|
2013-11-24 19:26:14 -06:00
|
|
|
public function testSuccess()
|
2013-11-20 02:13:41 -06:00
|
|
|
{
|
2013-11-24 20:12:54 -06:00
|
|
|
$result = h_parse($this->parser, "95\xa2");
|
2013-11-24 19:26:14 -06:00
|
|
|
$this->assertEquals("95\xa2", $result);
|
|
|
|
|
}
|
2013-11-20 02:13:41 -06:00
|
|
|
public function testFailure()
|
|
|
|
|
{
|
2013-11-20 18:45:02 -06:00
|
|
|
$result = h_parse($this->parser, "95");
|
2013-11-24 19:26:14 -06:00
|
|
|
$this->assertEquals(NULL, $result);
|
2013-11-20 02:13:41 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|