Skip to content

Commit

Permalink
Add getAllBanks()
Browse files Browse the repository at this point in the history
  • Loading branch information
ariselseng committed Feb 4, 2020
1 parent 2a690a9 commit 7ba089f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ariselseng/norwegianbanks",
"description": "Library to get information about norwegian banks and validate accounts",
"license": "MIT",
"version": "0.5",
"version": "0.6",
"minimum-stability": "stable",
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions src/NorwegianBanks.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public function getAllPrefixes()
{
return array_keys($this->prefixToBankCode);
}

public function getAllBanks()
{
return $this->banks;
}
}

class NorwegianBanksStatic
Expand Down
6 changes: 6 additions & 0 deletions tests/NorwegianBanksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ public function testGetAllPrefixes() {
$this->assertNotContains('Bank identifier', $prefixes);
$this->assertContains('1594', $prefixes);
}

public function testGetAllBanks() {
$banks = $this->norwegianBanks->getAllBanks();
$this->assertContainsOnlyInstancesOf('Ariselseng\NorwegianBanks\NorwegianBank', $banks);
$this->assertArrayHasKey($this->accounts[0]['bankCode'], $banks);
}
}

0 comments on commit 7ba089f

Please # to comment.