diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_queries.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_queries.php b/test/test_queries.php index c045347..d72c101 100644 --- a/test/test_queries.php +++ b/test/test_queries.php @@ -140,6 +140,13 @@ $expected = "SELECT * FROM `widget` FULL OUTER JOIN `widget_handle` ON `widget_handle`.`widget_id` = `widget`.`id`"; Tester::check_equal("Full outer join", $expected); + ORM::for_table('widget') + ->join('widget_handle', array('widget_handle.widget_id', '=', 'widget.id')) + ->join('widget_nozzle', array('widget_nozzle.widget_id', '=', 'widget.id')) + ->find_many(); + $expected = "SELECT * FROM `widget` JOIN `widget_handle` ON `widget_handle`.`widget_id` = `widget`.`id` JOIN `widget_nozzle` ON `widget_nozzle`.`widget_id` = `widget`.`id`"; + Tester::check_equal("Multiple join sources", $expected); + ORM::for_table('widget')->join('widget_handle', array('wh.widget_id', '=', 'widget.id'), 'wh')->find_many(); $expected = "SELECT * FROM `widget` JOIN `widget_handle` `wh` ON `wh`.`widget_id` = `widget`.`id`"; Tester::check_equal("Join with alias", $expected); |