From be08c128e0168f9d9414586f5f65433be3fa7171 Mon Sep 17 00:00:00 2001
From: "Meredith L. Patterson" <mlp@thesmartpolitenerd.com>
Date: Sun, 24 Nov 2013 20:49:23 -0600
Subject: [PATCH] h_int_range works

---
 src/bindings/php/Tests/IntRangeTest.php | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 src/bindings/php/Tests/IntRangeTest.php

diff --git a/src/bindings/php/Tests/IntRangeTest.php b/src/bindings/php/Tests/IntRangeTest.php
new file mode 100644
index 00000000..ce56fce2
--- /dev/null
+++ b/src/bindings/php/Tests/IntRangeTest.php
@@ -0,0 +1,23 @@
+<?php
+include_once 'hammer.php';
+
+class IntRangeTest extends PHPUnit_Framework_TestCase
+{
+    protected $parser;
+
+    protected function setUp()
+    {
+        $this->parser = h_int_range(h_uint8(), 3, 10);
+    }
+    public function testSuccess()
+    {
+        $result = h_parse($this->parser, "\x05");
+        $this->assertEquals(5, $result);
+    }
+    public function testFailure()
+    {
+        $result = h_parse($this->parser, "\xb");
+        $this->assertEquals(NULL, $result);
+    }
+}
+?>
\ No newline at end of file
-- 
GitLab