Skip to content

Commit

Permalink
MDL-35238 Fix the unit test for invalid input_manager::TYPE_URL values
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Nov 8, 2012
1 parent b10b1e7 commit 5bd9b0a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mdeploytest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ public function data_for_cast_value() {
input_manager::TYPE_URL,
'https://moodle.org/plugins/download.php/1292/mod_stampcoll_moodle23_2012062201.zip'
),
array('file:///etc/passwd', input_manager::TYPE_URL, ''),

array('5e8d2ea4f50d154730100b1645fbad67', input_manager::TYPE_MD5, '5e8d2ea4f50d154730100b1645fbad67'),
);
Expand All @@ -157,6 +156,15 @@ public function test_cast_object_argument() {
$input->cast_value($o, input_manager::TYPE_INT); // must throw exception
}

/**
* @expectedException invalid_option_exception
*/
public function test_cast_invalid_url_value() {
$input = testable_input_manager::instance();
$invalid = 'file:///etc/passwd';
$input->cast_value($invalid, input_manager::TYPE_URL); // must throw exception
}

/**
* @expectedException invalid_option_exception
*/
Expand Down

0 comments on commit 5bd9b0a

Please sign in to comment.