Skip to content

Commit

Permalink
Merge pull request #78 from seegno/enhancement/add-getter-for-currenc…
Browse files Browse the repository at this point in the history
…ies-to-user-model

Add getter for currencies to user model
  • Loading branch information
nunofgs committed Jul 13, 2015
2 parents d38b91d + f3aa60f commit ce9209a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Bitreserve/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class User extends BaseModel implements UserInterface
*/
protected $country;

/**
* Currencies.
*
* @var string
*/
protected $currencies;

/**
* Email.
*
Expand Down Expand Up @@ -178,6 +185,14 @@ public function getCountry()
return $this->country;
}

/**
* {@inheritdoc}
*/
public function getCurrencies()
{
return $this->currencies;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions lib/Bitreserve/Model/UserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public function getContacts();
*/
public function getCountry();

/**
* Gets user currencies.
*
* @return $currencies
*/
public function getCurrencies();

/**
* Gets user email.
*
Expand Down
14 changes: 14 additions & 0 deletions test/Bitreserve/Tests/Unit/Model/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ public function shouldReturnCountry()
$this->assertEquals($data['country'], $user->getCountry());
}

/**
* @test
*/
public function shouldReturnCurrencies()
{
$data = array('currencies' => array('BTC', 'EUR', 'USD'));

$client = $this->getBitreserveClientMock();

$user = new User($client, $data);

$this->assertEquals($data['currencies'], $user->getCurrencies());
}

/**
* @test
*/
Expand Down

0 comments on commit ce9209a

Please sign in to comment.