Changeset 20854
- Timestamp:
- 08/06/09 15:41:31 (4 years ago)
- Files:
-
- branches/1.3/lib/task/sfTask.class.php (modified) (1 diff)
- branches/1.3/test/unit/task/sfTaskTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/task/sfTask.class.php
r20846 r20854 151 151 if (is_string($name)) 152 152 { 153 if (false === $value )153 if (false === $value || is_null($value)) 154 154 { 155 155 unset($options[$name]); branches/1.3/test/unit/task/sfTaskTest.php
r20849 r20854 10 10 require_once dirname(__FILE__).'/../../bootstrap/unit.php'; 11 11 12 $t = new lime_test(1 2);12 $t = new lime_test(15); 13 13 14 14 abstract class BaseTestTask extends sfTask … … 58 58 $t->is_deeply($task->lastArguments, array('foo' => 'FOO', 'bar' => 'BAR'), '->run() accepts a string of arguments'); 59 59 60 $task->run(array('foo' => 'FOO', 'bar' => null)); 61 $t->is_deeply($task->lastArguments, array('foo' => 'FOO', 'bar' => null), '->run() accepts an associative array of arguments when optional arguments are passed as null'); 62 63 $task->run(array('bar' => null, 'foo' => 'FOO')); 64 $t->is_deeply($task->lastArguments, array('foo' => 'FOO', 'bar' => null), '->run() accepts an unordered associative array of arguments when optional arguments are passed as null'); 65 60 66 class ArgumentsTest2Task extends BaseTestTask 61 67 { … … 101 107 $t->is_deeply($task->lastOptions, array('none' => false, 'required' => 'TEST1', 'optional' => null, 'array' => array('one', 'two', 'three')), '->run() accepts an associative array of option values'); 102 108 109 $task->run(array(), array('optional' => null)); 110 $t->is_deeply($task->lastOptions, array('none' => false, 'required' => null, 'optional' => null, 'array' => array()), '->run() accepts an associative array of options when optional values are passed as null'); 111 103 112 $task->run('--none --required=TEST1 --array=one --array=two --array=three'); 104 113 $t->is_deeply($task->lastOptions, array('none' => true, 'required' => 'TEST1', 'optional' => null, 'array' => array('one', 'two', 'three')), '->run() accepts a string of options');