summaryrefslogtreecommitdiff
path: root/Examples/ReturnObject/test.php
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/ReturnObject/test.php')
-rw-r--r--Examples/ReturnObject/test.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/Examples/ReturnObject/test.php b/Examples/ReturnObject/test.php
new file mode 100644
index 0000000..8fa8b6c
--- /dev/null
+++ b/Examples/ReturnObject/test.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Test script to see if the ReturnObject extension works as it should
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2015 Copernica BV
+ */
+
+/**
+ * Construct master object
+ * @var Master
+ */
+$master = new Master();
+
+/**
+ * Construct derived child object
+ * @var Child
+ */
+$child1 = new Child();
+
+/**
+ * Fetch the child object that is stored as member var in the master
+ * @var Child
+ */
+$child2 = $master->child();
+
+/**
+ * Show output, expected is:
+ * this is the master
+ * this is the child
+ * this is the child
+ */
+echo(strval($master)."\n");
+echo(strval($child1)."\n");
+echo(strval($child2)."\n");
+