Skip to content

Commit

Permalink
Add getter for currencies to user model
Browse files Browse the repository at this point in the history
Closes #76.
  • Loading branch information
Nuno Rafael Rocha committed Apr 24, 2015
1 parent caeff1b commit c2fc3f1
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 c2fc3f1

Please sign in to comment.