summaryrefslogtreecommitdiff
path: root/Examples/ReturnObject/test.php
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-06-23 09:51:20 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-06-23 09:51:20 +0200
commitceac7c034aab703772231ea3b8375abec67cd3d9 (patch)
treef8a2794669d1c103be0b9a413bf0f36650aa6790 /Examples/ReturnObject/test.php
parent01990e0f64aac57050a00c0f41fbd0ef2a5d0ad3 (diff)
Added extra example script (i thought this was a bug, but in this small setup thinks work as expected)
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");
+