Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/share/schema/test_tables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@
</property>
</type>

<type name="ytype" table="ytype">
<property name="id" type="unsigned integer" primaryfield="id">
<description>Local non-replication-safe database identifier</description>
</property>
<property name="objectguid" type="guid" parentfield="objectguid">
<description>Link to A-table</description>
</property>
<property name="y1" type="string">
<description>Y1-field</description>
</property>
<property name="y2" type="string">
<description>Y2-field</description>
</property>
</type>

<type name="ztype" table="ztype" parent="atype">
<property name="id" type="unsigned integer" primaryfield="id">
<description>Local non-replication-safe database identifier</description>
Expand Down
27 changes: 27 additions & 0 deletions tests_templates/053-create_children.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
test for creating child objects with guid parent field
--SKIPIF--
<?php if (!extension_loaded("midgard2")) print "skip"; ?>
--INI--
midgard.engine = On
midgard.http = On
midgard.memory_debug = Off
midgard.configuration=
midgard.configuration_file=[[CFG_FILE]]
report_memleaks = On
--FILE--
<?php
$a = new atype();
$a->create();
$y = new ytype();
$y->objectguid = $a->guid;

var_dump($y->create());
var_dump($y->delete());
$a->delete();
?>
===DONE===
--EXPECTF--
bool(true)
bool(true)
===DONE===