public function testGetInput() { $args = _Args('test-task', '--key1', 'value', '--flag', 'special'); $this->dispatcher->T_set_cli_input($this->dispatcher->T_ParseArguments($args)); $gathered_input = $this->dispatcher->T_GetInput(TestTask::InputList()); $this->assertEquals(1, $gathered_input->Count()); $this->assertEquals('value', $gathered_input->key1); $this->assertNull($gathered_input->key2); }
public function testGetInputPOSTMissingKey() { $_POST['key1'] = 'foo'; $this->dispatcher->T_set_request_method('POST'); $gathered_input = $this->dispatcher->T_GetInput(TestTask::InputList()); $this->assertEquals(2, $gathered_input->Count()); $this->assertEquals('foo', $gathered_input->key1); $this->assertEquals('POST', $gathered_input->_method); $this->assertNull($gathered_input->key2); }