From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- .../tests/gtCommandLineOptionsTest.php | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php (limited to 'scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php') diff --git a/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php new file mode 100644 index 0000000..2fd6818 --- /dev/null +++ b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php @@ -0,0 +1,46 @@ +parse(array('generate-phpt.php')); + } + + public function testShortOption() { + $clo = new gtCommandLineOptions(); + $clo->parse(array('generate-phpt.php', '-h')); + $this->assertTrue($clo->hasOption('h')); + } + + public function testShortOptionArgument() { + $clo = new gtCommandLineOptions(); + $clo->parse(array('generate-phpt.php', '-f', 'some-function')); + $this->assertTrue($clo->hasOption('f')); + $this->assertEquals('some-function', $clo->getOption('f')); + } + + /** + * @expectedException RuntimeException + */ + public function testInvalidOption() { + $clo = new gtCommandLineOptions(); + $clo->parse(array('generate-phpt.php', '-z')); + } + + /** + * @expectedException RuntimeException + */ + public function testMissingArgument() { + $clo = new gtCommandLineOptions(); + $clo->parse(array('generate-phpt.php', '-f')); + } + } +?> \ No newline at end of file -- cgit v1.2.1