typemap for HParseResult is returning the appropriate zval, but why does PHP think it's null?
This commit is contained in:
parent
0810bd33d2
commit
49ca034b32
3 changed files with 81 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
include 'hammer.php';
|
||||
include_once 'hammer.php';
|
||||
|
||||
class TokenTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
|
@ -8,24 +8,18 @@ class TokenTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->parser = h_token("95\xa2");
|
||||
$this->parser = hammer::h_token("95\xa2");
|
||||
}
|
||||
public function testSuccess()
|
||||
public function testSuccess()
|
||||
{
|
||||
$result = h_parse($this->parser, "95\xa2");
|
||||
//var_dump($result);
|
||||
$ast = hparseresult_ast_get($result);
|
||||
//var_dump($ast);
|
||||
$token_data = hparsedtoken_token_data_get($ast);
|
||||
//var_dump($token_data);
|
||||
$bytes = htokendata_bytes_get($token_data);
|
||||
//var_dump($bytes);
|
||||
$this->assertEquals($bytes, "95\xa2");
|
||||
}
|
||||
$result = hammer::h_parse($this->parser, "95\xa2");
|
||||
var_dump($result);
|
||||
$this->assertEquals("95\xa2", $result);
|
||||
}
|
||||
public function testFailure()
|
||||
{
|
||||
$result = h_parse($this->parser, "95");
|
||||
$this->assertEquals($result, NULL);
|
||||
$this->assertEquals(NULL, $result);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue