Skip to content

Commit

Permalink
Extend assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 26, 2015
1 parent d7ab577 commit f93fa0a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions framework/ManageSieve/test/Horde/ManageSieve/ManageSieveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ public function testConnect()
public function testLogin()
{
$this->fixture->connect($this->config['host'], $this->config['port']);
$this->fixture->login($this->config['username'], $this->config['password'], null, '', false);
$this->fixture->login($this->config['username'], $this->config['password']);
}

public function testDisconnect()
{
$this->fixture->connect($this->config['host'], $this->config['port']);
$this->fixture->login($this->config['username'], $this->config['password'], null, '', false);
$this->fixture->login($this->config['username'], $this->config['password']);
$this->fixture->disconnect();
}

public function testListScripts()
{
$this->login();
$this->fixture->listScripts();
$this->assertInternalType('array', $this->fixture->listScripts());
$this->logout();
}

Expand Down Expand Up @@ -171,7 +171,7 @@ public function testInstallScriptLarge()
}

/**
* See bug #16691.
* See PEAR bug #16691.
*/
public function testInstallNonAsciiScript()
{
Expand Down Expand Up @@ -209,16 +209,16 @@ public function testGetActive()
{
$this->clear();
$this->login();
$active_script = $this->fixture->getActive();
$this->fixture->getActive();
$this->logout();
}

public function testSetActive()
{
$this->clear();
$scriptname = 'test script1';
$this->login();
$result = $this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
$scriptname = 'test script1';
$this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
$this->fixture->setActive($scriptname);
$active_script = $this->fixture->getActive();
$this->assertEquals($scriptname, $active_script, 'Active script does not match');
Expand All @@ -235,10 +235,14 @@ public function testSetActive()
public function testRemoveScript()
{
$this->clear();
$scriptname = 'test script1';
$this->login();
$scriptname = 'test script1';
$before_scripts = $this->fixture->listScripts();
$this->fixture->installScript($scriptname, $this->scripts[$scriptname]);
$this->fixture->removeScript($scriptname);
$after_scripts = $this->fixture->listScripts();
$diff_scripts = array_values(array_diff($after_scripts, $before_scripts));
$this->assertTrue(count($diff_scripts) == 0, 'Script still installed');
$this->logout();
}
}

0 comments on commit f93fa0a

Please sign in to comment.