Skip to content

Commit

Permalink
Merge dfb53a2 into 3b98b56
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Oram committed May 31, 2013
2 parents 3b98b56 + dfb53a2 commit 6b5f974
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/SclZfCartSagepayTests/Options/SagepayOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,48 @@ public function testGetSet()
$this->getSetCheck('testConnection', $this->getMock('SclZfCartSagepay\Options\ConnectionOptions'));
}


/**
* Test the set*Connection method when passed an array.
*
* @covers SclZfCartSagepay\Options\SagepayOptions::getLiveConnection
* @covers SclZfCartSagepay\Options\SagepayOptions::setLiveConnection
* @covers SclZfCartSagepay\Options\SagepayOptions::getTestConnection
* @covers SclZfCartSagepay\Options\SagepayOptions::setTestConnection
*
* @return void
*/
public function testConnectionSettersWithArray()
{
$live = array(
'url' => 'live_url',
'password' => 'live_pw',
);
$test = array(
'url' => 'test_url',
'password' => 'test_pw',
);

$this->options->setLiveConnection($live);
$this->options->setTestConnection($test);

$liveConn = $this->options->getLiveConnection();
$testConn = $this->options->getTestConnection();

$this->assertEquals($live['url'], $liveConn->getUrl(), 'Live URL is incorrect.');
$this->assertEquals($test['url'], $testConn->getUrl(), 'Test URL is incorrect.');

$this->assertEquals($live['password'], $liveConn->getPassword(), 'Live password is incorrect.');
$this->assertEquals($test['password'], $testConn->getPassword(), 'Test password is incorrect.');
}

/**
* testGetConnection
*
* @covers SclZfCartSagepay\Options\SagepayOptions::getConnectionOptions
*
* @return void
*/
public function testGetConnection()
{
$liveConnection = new ConnectionOptions();
Expand Down

0 comments on commit 6b5f974

Please sign in to comment.