summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-03-20 21:01:06 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-03-20 21:01:06 +0100
commitd48bcdb42c1e80fa258ebbd70d9fe6f649237a78 (patch)
treecb023b12449c1a007edffb5d843f0379115ed888 /_test
parentb0b7909bdd454e9614f4ffe34f384b0da0ce4585 (diff)
downloadrpg-d48bcdb42c1e80fa258ebbd70d9fe6f649237a78.tar.gz
rpg-d48bcdb42c1e80fa258ebbd70d9fe6f649237a78.tar.bz2
fixed tests
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/cli_options.test.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/_test/tests/inc/cli_options.test.php b/_test/tests/inc/cli_options.test.php
index 1d121d7ce..ab03ee29b 100644
--- a/_test/tests/inc/cli_options.test.php
+++ b/_test/tests/inc/cli_options.test.php
@@ -4,37 +4,37 @@ class cli_options extends DokuWikiTest {
function test_simpleshort() {
$options = new DokuCLI_Options();
- $options->registerOption('exclude', 'exclude files', 'x', true);
+ $options->registerOption('exclude', 'exclude files', 'x', 'file');
- $args = array('-x', 'foo', 'bang');
- $options->parseOptions($args);
+ $options->args = array('-x', 'foo', 'bang');
+ $options->parseOptions();
$this->assertEquals('foo', $options->getOpt('exclude'));
- $this->assertEquals(array('bang'), $args);
+ $this->assertEquals(array('bang'), $options->args);
$this->assertFalse($options->getOpt('nothing'));
}
function test_simplelong1() {
$options = new DokuCLI_Options();
- $options->registerOption('exclude', 'exclude files', 'x', true);
+ $options->registerOption('exclude', 'exclude files', 'x', 'file');
- $args = array('--exclude', 'foo', 'bang');
- $options->parseOptions($args);
+ $options->args = array('--exclude', 'foo', 'bang');
+ $options->parseOptions();
$this->assertEquals('foo', $options->getOpt('exclude'));
- $this->assertEquals(array('bang'), $args);
+ $this->assertEquals(array('bang'), $options->args);
$this->assertFalse($options->getOpt('nothing'));
}
function test_simplelong2() {
$options = new DokuCLI_Options();
- $options->registerOption('exclude', 'exclude files', 'x', true);
+ $options->registerOption('exclude', 'exclude files', 'x', 'file');
- $args = array('--exclude=foo', 'bang');
- $options->parseOptions($args);
+ $options->args = array('--exclude=foo', 'bang');
+ $options->parseOptions();
$this->assertEquals('foo', $options->getOpt('exclude'));
- $this->assertEquals(array('bang'), $args);
+ $this->assertEquals(array('bang'), $options->args);
$this->assertFalse($options->getOpt('nothing'));
}
@@ -45,12 +45,12 @@ class cli_options extends DokuWikiTest {
$options->registerCommand('status', 'display status info');
$options->registerOption('long', 'display long lines', 'l', false, 'status');
- $args = array('-p', 'status', '--long', 'foo');
- $options->parseOptions($args);
+ $options->args = array('-p', 'status', '--long', 'foo');
+ $options->parseOptions();
$this->assertEquals('status', $options->getCmd());
$this->assertTrue($options->getOpt('plugins'));
$this->assertTrue($options->getOpt('long'));
- $this->assertEquals(array('foo'), $args);
+ $this->assertEquals(array('foo'), $options->args);
}
} \ No newline at end of file