From: <las...@us...> - 2010-04-02 18:34:42
|
Revision: 1989 http://simpletest.svn.sourceforge.net/simpletest/?rev=1989&view=rev Author: lastcraft Date: 2010-04-02 18:34:35 +0000 (Fri, 02 Apr 2010) Log Message: ----------- Extra test for lots of arguments Modified Paths: -------------- simpletest/trunk/arguments.php simpletest/trunk/test/arguments_test.php Modified: simpletest/trunk/arguments.php =================================================================== --- simpletest/trunk/arguments.php 2010-04-02 11:34:03 UTC (rev 1988) +++ simpletest/trunk/arguments.php 2010-04-02 18:34:35 UTC (rev 1989) @@ -137,6 +137,9 @@ $this->banner = $banner; } + function explainFlag($flags, $explanation) { + } + function render() { return $this->banner . "\n"; } Modified: simpletest/trunk/test/arguments_test.php =================================================================== --- simpletest/trunk/test/arguments_test.php 2010-04-02 11:34:03 UTC (rev 1988) +++ simpletest/trunk/test/arguments_test.php 2010-04-02 18:34:35 UTC (rev 1989) @@ -40,12 +40,24 @@ $this->assertIdentical($arguments->aa, 'AA'); $this->assertIdentical($arguments->bb, 'BB'); } + + function testGetsFullSetOfResultsAsHash() { + $arguments = new SimpleArguments(array('me', '-a', '-b=1', '-b', '2', '--aa=AA', '--bb', 'BB', '-c')); + $this->assertEqual($arguments->all(), + array('a' => true, 'b' => array('1', '2'), 'aa' => 'AA', 'bb' => 'BB', 'c' => true)); + } } class TestOfHelpOutput extends UnitTestCase { function testDisplaysGeneralHelpBanner() { - $help = new SimpleHelp("This program is cool"); + $help = new SimpleHelp('This program is cool'); $this->assertPattern('/This program is cool/', $help->render()); } + + function testDisplaysHelpOnShortFlag() { + $help = new SimpleHelp('This program is cool'); + $help->explainFlag('a', 'This enables the AAA widget'); + $this->assertPattern('/-a\tThis enables the AA widget/', $help->render()); + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |