MDL-44725 Availability: Add utility API to make unit testing easier (7)
authorsam marshall <s.marshall@open.ac.uk>
Tue, 26 Aug 2014 17:07:16 +0000 (18:07 +0100)
committersam marshall <s.marshall@open.ac.uk>
Tue, 2 Sep 2014 12:03:19 +0000 (13:03 +0100)
commitf9103882dc3fca7d8611213b2a97be019394c913
tree76b5e23c74beac635180891840d947c7052fee7f
parent9c85baa8c564e5041bb4006db30e70288292c1a8
MDL-44725 Availability: Add utility API to make unit testing easier (7)

Previously there was no way in PHP to create the JSON values used for
availability, except by manually hard-coding them (the main code to
do this normally is in JavaScript).

This makes unit tests hard to read, so I have implemented static
functions tree::get_root_json and tree::get_nested_json which allow
for easier-to-read unit tests.
availability/classes/tree.php
availability/condition/group/classes/condition.php
availability/condition/grouping/classes/condition.php
availability/tests/tree_test.php