Skip to content

Commit 005aa6b

Browse files
committed
Add failing test regarding missing input
1 parent 6d20ccc commit 005aa6b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/PHPSemVerChecker/Console/InputMergerTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,20 @@ public function testMerge()
3333
$this->assertEquals('src-after config', $input->getArgument('source-after'), 'Missing input arguments must take on existing configuration');
3434
$this->assertEquals(true, $config->get('full-path'), 'CLI option should use Configuration value and not CLI default');
3535
}
36+
37+
/**
38+
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
39+
*/
40+
public function testEmptyInputShouldThrowException()
41+
{
42+
// Default/empty configuration
43+
$config = new Configuration([]);
44+
// No input arguments
45+
$input = new InspectableArgvInput([null]);
46+
$command = new CompareCommand();
47+
$input->bind($command->getDefinition());
48+
$im = new InputMerger();
49+
$im->merge($input, $config);
50+
$input->validate();
51+
}
3652
}

0 commit comments

Comments
 (0)