Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,25 @@ public function add_args($arg_key, $value = NULL) {
elseif ($arg_key == "v")
$this->verbose_flag = "-vvv";
elseif ($arg_key == "force")
$this->force_flag = "-force";
$this->force_flag = "--force";
elseif ($arg_key == "only")
$this->only_flag = "-only";
$this->only_flag = "--only";
elseif ($arg_key == "onlyAutomate")
$this->only_automate_flag = "-onlyAutomate";
$this->only_automate_flag = "--onlyAutomate";
elseif ($arg_key == "forcelocal")
$this->force_local_flag = "-forcelocal";
$this->force_local_flag = "--force-local";
elseif ($arg_key == "localIdentifier")
$this->local_identifier_flag = "-localIdentifier $value";
$this->local_identifier_flag = "--localIdentifier $value";
elseif ($arg_key == "proxyHost")
$this->proxy_host = "-proxyHost $value";
$this->proxy_host = "--proxyHost $value";
elseif ($arg_key == "proxyPort")
$this->proxy_port = "-proxyPort $value";
$this->proxy_port = "--proxyPort $value";
elseif ($arg_key == "proxyUser")
$this->proxy_user = "-proxyUser $value";
$this->proxy_user = "--proxyUser $value";
elseif ($arg_key == "proxyPass")
$this->proxy_pass = "-proxyPass $value";
$this->proxy_pass = "--proxyPass $value";
elseif ($arg_key == "forceproxy")
$this->force_proxy_flag = "-forceproxy";
$this->force_proxy_flag = "--forceproxy";
elseif ($arg_key == "hosts")
$this->hosts = $value;
elseif ($arg_key == "f") {
Expand Down
16 changes: 8 additions & 8 deletions tests/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ public function test_enable_force() {

public function test_set_local_identifier() {
$this->bs_local->add_args("localIdentifier", "randomString");
$this->assertContains('-localIdentifier randomString',$this->bs_local->start_command());
$this->assertContains('--localIdentifier randomString',$this->bs_local->start_command());
}

public function test_enable_only() {
$this->bs_local->add_args("only");
$this->assertContains('-only',$this->bs_local->start_command());
$this->assertContains('--only',$this->bs_local->start_command());
}

public function test_enable_only_automate() {
$this->bs_local->add_args("onlyAutomate");
$this->assertContains('-onlyAutomate', $this->bs_local->start_command());
$this->assertContains('--onlyAutomate', $this->bs_local->start_command());
}

public function test_enable_force_local() {
$this->bs_local->add_args("forcelocal");
$this->assertContains('-forcelocal',$this->bs_local->start_command());
$this->assertContains('--force-local',$this->bs_local->start_command());
}

public function test_custom_boolean_argument() {
Expand All @@ -74,16 +74,16 @@ public function test_set_proxy() {
$this->bs_local->add_args("proxyPort", 8080);
$this->bs_local->add_args("proxyUser", "user");
$this->bs_local->add_args("proxyPass", "pass");
$this->assertContains('-proxyHost localhost -proxyPort 8080 -proxyUser user -proxyPass pass',$this->bs_local->start_command());
$this->assertContains('--proxyHost localhost --proxyPort 8080 --proxyUser user --proxyPass pass',$this->bs_local->start_command());
}

public function test_enable_force_proxy() {
$this->bs_local->add_args("-forceproxy");
$this->assertContains('-forceproxy',$this->bs_local->start_command());
$this->bs_local->add_args("forceproxy");
$this->assertContains('--forceproxy',$this->bs_local->start_command());
}

public function test_hosts() {
$this->bs_local->add_args("-hosts", "localhost,8080,0");
$this->bs_local->add_args("--hosts", "localhost,8080,0");
$this->assertContains('localhost,8080,0',$this->bs_local->start_command());
}

Expand Down