See Release Notes
Long Term Support Release
Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]
PHPUnit for property_list class.
Author: | Andrew Madden <andrewmadden@catalyst-au.net> |
Copyright: | 2019 Catalyst IT |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 432 lines (21 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
quizaccess_seb_property_list_testcase:: (20 methods):
test_create_empty_plist()
test_construct_plist_from_xml()
test_add_element_to_root()
test_get_element_value()
test_get_element_value_if_not_exists()
test_get_element_value_if_array()
test_updating_element_value()
test_updating_element_value_with_bad_data()
test_updating_element_array_if_dictionary()
test_updating_element_array_if_dictionary_with_bad_data()
test_delete_element()
test_delete_element_if_not_exists()
test_export_to_json()
test_export_to_json_full_file()
test_set_or_update_value()
get_plist_xml_header()
get_plist_xml_footer()
good_update_data_provider()
bad_update_data_provider()
json_data_provider()
Class: quizaccess_seb_property_list_testcase - X-Ref
PHPUnit for property_list class.test_create_empty_plist() X-Ref |
Test that an empty PList with a root dictionary is created. |
test_construct_plist_from_xml() X-Ref |
Test that a Plist is constructed from an XML string. |
test_add_element_to_root() X-Ref |
Test that an element can be added to the root dictionary. |
test_get_element_value() X-Ref |
Test that an element's value can be retrieved. |
test_get_element_value_if_not_exists() X-Ref |
Test that an element's value can be retrieved. |
test_get_element_value_if_array() X-Ref |
Test an element's value can be retrieved if it is an array. |
test_updating_element_value($xml, $key, $value) X-Ref |
Test that a element's value can be updated that is not an array or dictionary. param: string $xml XML to create PList. param: string $key Key of element to try and update. param: mixed $value Value to try to update with. |
test_updating_element_value_with_bad_data(string $xml, string $key, $value, $expected, $exceptionmessage) X-Ref |
Test that a element's value can be updated that is not an array or dictionary. param: string $xml XML to create PList. param: string $key Key of element to try and update. param: mixed $value Bad value to try to update with. param: mixed $expected Expected value of element after update is called. param: string $exceptionmessage Message of exception expected to be thrown. |
test_updating_element_array_if_dictionary() X-Ref |
Test that a dictionary can have it's value (array) updated. |
test_updating_element_array_if_dictionary_with_bad_data() X-Ref |
Test that a dictionary can have it's value (array) updated. |
test_delete_element() X-Ref |
Test that an element can be deleted. |
test_delete_element_if_not_exists() X-Ref |
Test that an element can be deleted. |
test_export_to_json($xml, $expectedjson) X-Ref |
Test that json is exported correctly according to SEB Config Key requirements. param: string $xml PList XML used to generate CFPropertyList. param: string $expectedjson Expected JSON output. |
test_export_to_json_full_file() X-Ref |
Test that the xml is exported to JSON from a real SEB config file. Expected JSON extracted from SEB logs. |
test_set_or_update_value() X-Ref |
Test the set_or_update_value function. |
get_plist_xml_header() X-Ref |
Get a valid PList header. Must also use footer. return: string |
get_plist_xml_footer() X-Ref |
Get a valid PList footer. Must also use header. return: string |
good_update_data_provider() X-Ref |
Data provider for good data on update. return: array Array with test data. |
bad_update_data_provider() X-Ref |
Data provider for bad data on update. return: array Array with test data. |
json_data_provider() X-Ref |
Data provider for expected JSON from PList. Examples extracted from requirements listed in SEB Config Key documents. https://safeexambrowser.org/developer/seb-config-key.html 1. Date should be in ISO 8601 format. 2. Data should be base 64 encoded. 3. String should be UTF-8 encoded. 4, 5, 6, 7. No requirements for bools, arrays or dicts. 8. Empty dicts should not be included. 9. JSON key ordering should be case insensitive, and use string ordering. 10. URL forward slashes should not be escaped. return: array |