aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/php/newobject3_runme.php
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/php/newobject3_runme.php')
-rw-r--r--Examples/test-suite/php/newobject3_runme.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/Examples/test-suite/php/newobject3_runme.php b/Examples/test-suite/php/newobject3_runme.php
new file mode 100644
index 000000000..edd5d8608
--- /dev/null
+++ b/Examples/test-suite/php/newobject3_runme.php
@@ -0,0 +1,18 @@
+<?php
+
+require "tests.php";
+require "newobject3.php";
+
+$factory = new factory();
+
+check::classname("Product", $factory->create(7));
+check::classname("Product", $factory->create(7, 6));
+check::classname("Product", $factory->create("test"));
+check::classname("Product", $factory->create("test", 2));
+
+check::isnull($factory->create(0), "create(0) should be NULL");
+check::isnull($factory->create(7, -1), "create(7, -1) should be NULL");
+check::isnull($factory->create(0, -1), "create(0, -1) should be NULL");
+check::isnull($factory->create("bad", -1), "create(\"bad\", -1) should be NULL");
+
+?>