[ Index ]

PHP Cross Reference of Moodle 310

title

Body

[close]

/lib/form/tests/ -> filetypes_util_test.php (summary)

Provides the {@link core_form\filetypes_util_testcase} class.

Copyright: 2017 David Mudrák <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 509 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

filetypes_util_testcase:: (14 methods):
  test_normalize_file_types()
  test_looks_like_mimetype()
  test_is_filetype_group()
  test_describe_file_types()
  test_expand()
  test_is_listed()
  test_get_not_listed()
  test_data_for_browser()
  is_allowed_file_type_provider()
  test_is_allowed_file_type()
  get_unknown_file_types_provider()
  test_get_unknown_file_types()
  test_deprecation_is_whitelisted()
  test_deprecation_get_not_whitelisted()


Class: filetypes_util_testcase  - X-Ref

Test cases for the {@link core_form\filetypes_util} class.

test_normalize_file_types()   X-Ref
Test normalizing list of extensions.


test_looks_like_mimetype()   X-Ref
Test MIME type formal recognition.


test_is_filetype_group()   X-Ref
Test getting/checking group.


test_describe_file_types()   X-Ref
Test describing list of extensions.


test_expand()   X-Ref
Test expanding mime types into extensions.


test_is_listed()   X-Ref
Test checking that a type is among others.


test_get_not_listed()   X-Ref
Test getting types not present in a list.


test_data_for_browser()   X-Ref
Test populating the tree for the browser.


is_allowed_file_type_provider()   X-Ref
Data provider for testing test_is_allowed_file_type.

return: array

test_is_allowed_file_type($filename, $list, $expected)   X-Ref
Test is_allowed_file_type().

param: string $filename The filename to check
param: string $list The space , or ; separated list of types supported
param: boolean $expected The expected result. True if the file is allowed, false if not.

get_unknown_file_types_provider()   X-Ref
Data provider for testing test_get_unknown_file_types.

return: array

test_get_unknown_file_types($filetypes, $expected)   X-Ref
Test get_unknown_file_types().

param: string $filetypes The filetypes to check
param: array $expected The expected result. The list of non existant file types.

test_deprecation_is_whitelisted()   X-Ref
Test that a debugging noticed is displayed when calling is_whitelisted().


test_deprecation_get_not_whitelisted()   X-Ref
Test that a debugging noticed is displayed when calling get_not_whitelisted().




Generated: Wed Jan 22 11:59:49 2025 Cross-referenced by PHPXref 0.7.1