[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/question/format/xml/tests/ -> xmlformat_test.php (summary)

Unit tests for the Moodle XML format.

Copyright: 2010 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1584 lines (55 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

qformat_xml_test:: (33 methods):
  assert_same_xml()
  make_test_question()
  remove_irrelevant_form_data_fields()
  itemid_to_files()
  test_xml_escape_simple_input_not_escaped()
  test_xml_escape_html_wrapped_in_cdata()
  test_xml_escape_script_tag_handled_ok()
  test_xml_escape_code_that_looks_like_cdata_end_ok()
  test_write_hint_basic()
  test_write_hint_with_parts()
  test_import_hints_no_parts()
  test_import_hints_with_parts()
  test_import_no_hints_no_error()
  test_import_description()
  test_export_description()
  test_import_essay_20()
  test_import_essay_21()
  test_export_essay()
  test_import_match_19()
  test_export_match()
  test_import_multichoice_19()
  test_export_multichoice()
  test_import_numerical_19()
  test_export_numerical()
  test_import_shortanswer_19()
  test_export_shortanswer()
  test_import_truefalse_19()
  test_export_truefalse()
  test_import_multianswer()
  test_export_multianswer()
  test_export_multianswer_withdollars()
  test_import_files_as_draft()
  test_import_truefalse_wih_files()


Class: qformat_xml_test  - X-Ref

Unit tests for the matching question definition class.

assert_same_xml($expectedxml, $xml)   X-Ref
No description

make_test_question()   X-Ref
No description

remove_irrelevant_form_data_fields($expectedq)   X-Ref
The data the XML import format sends to save_question is not exactly
the same as the data returned from the editing form, so this method
makes necessary changes to the return value of
test_question_maker::get_question_form_data so that the tests can work.

param: object $expectedq as returned by get_question_form_data.
return: object one more likely to match the return value of import_...().

itemid_to_files($var)   X-Ref
Becuase XML import uses a files array instead of an itemid integer to
handle saving files with a question, we need to covert the output of
test_question_maker::get_question_form_data to match. This method recursively
replaces all array elements with key itemid with an array entry with
key files and value an empty array.

param: mixed $var any data structure.
return: mixed an equivalent structure with the relacements made.

test_xml_escape_simple_input_not_escaped()   X-Ref
No description

test_xml_escape_html_wrapped_in_cdata()   X-Ref
No description

test_xml_escape_script_tag_handled_ok()   X-Ref
No description

test_xml_escape_code_that_looks_like_cdata_end_ok()   X-Ref
No description

test_write_hint_basic()   X-Ref
No description

test_write_hint_with_parts()   X-Ref
No description

test_import_hints_no_parts()   X-Ref
No description

test_import_hints_with_parts()   X-Ref
No description

test_import_no_hints_no_error()   X-Ref
No description

test_import_description()   X-Ref
No description

test_export_description()   X-Ref
No description

test_import_essay_20()   X-Ref
No description

test_import_essay_21()   X-Ref
No description

test_export_essay()   X-Ref
No description

test_import_match_19()   X-Ref
No description

test_export_match()   X-Ref
No description

test_import_multichoice_19()   X-Ref
No description

test_export_multichoice()   X-Ref
No description

test_import_numerical_19()   X-Ref
No description

test_export_numerical()   X-Ref
No description

test_import_shortanswer_19()   X-Ref
No description

test_export_shortanswer()   X-Ref
No description

test_import_truefalse_19()   X-Ref
No description

test_export_truefalse()   X-Ref
No description

test_import_multianswer()   X-Ref
No description

test_export_multianswer()   X-Ref
No description

test_export_multianswer_withdollars()   X-Ref
No description

test_import_files_as_draft()   X-Ref
No description

test_import_truefalse_wih_files()   X-Ref
No description



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1