Skip to content

Commit

Permalink
Fixing broken tests when addressing account filters bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentscheffler committed Aug 20, 2020
1 parent d12c12a commit f2571f7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Entities/AccountFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AccountFilters
/**
* Filters to be applied.
*
* @var array<string,array<string>>
* @var array<string,array<string,array<string>>>
*/
protected $filters = [];

Expand Down Expand Up @@ -128,7 +128,7 @@ public function setOtherFilters(array $subtypes): void
/**
* Get all filters as array.
*
* @return array<string,array<string>>
* @return array<string,array<string,array<string>>>
*/
public function toArray(): array
{
Expand Down
16 changes: 10 additions & 6 deletions tests/AccountFiltersEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ public function test_constructor_sets_filters(): void
$accountFilters = new AccountFilters($filters);

$this->assertEquals(
$filters,
[
"depository" => [
"account_subtypes" => ["auth", "identity"]
]
],
$accountFilters->toArray()
);
}
Expand Down Expand Up @@ -45,7 +49,7 @@ public function test_set_depository_filters(): void
$this->assertEquals(
[
"depository" => [
"auth", "transactions", "identity", "income", "assets"
"account_subtypes" => ["auth", "transactions", "identity", "income", "assets"]
]
],
$accountFilters->toArray()
Expand All @@ -60,7 +64,7 @@ public function test_set_credit_filters(): void
$this->assertEquals(
[
"credit" => [
"transactions", "identity", "liabilities"
"account_subtypes" => ["transactions", "identity", "liabilities"]
]
],
$accountFilters->toArray()
Expand All @@ -75,7 +79,7 @@ public function test_set_investment_filters(): void
$this->assertEquals(
[
"investment" => [
"investments"
"account_subtypes" => ["investments"]
]
],
$accountFilters->toArray()
Expand All @@ -90,7 +94,7 @@ public function test_set_loan_filters(): void
$this->assertEquals(
[
"loan" => [
"transactions", "liabilities"
"account_subtypes" => ["transactions", "liabilities"]
]
],
$accountFilters->toArray()
Expand All @@ -105,7 +109,7 @@ public function test_set_other_filters(): void
$this->assertEquals(
[
"other" => [
"auth", "transactions", "identity", "assets"
"account_subtypes" => ["auth", "transactions", "identity", "assets"]
]
],
$accountFilters->toArray()
Expand Down
17 changes: 13 additions & 4 deletions tests/CreateLinkTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ public function test_account_filters(): void
);

$this->assertEquals(
(object) [
"depository" => ["auth", "transactions"]
],
\json_decode(
\json_encode(
[
"depository" => [
"account_subtypes" => ["auth", "transactions"]
]
]
)
),
$response->params->account_filters
);
}
Expand Down Expand Up @@ -117,7 +123,10 @@ public function test_redirect_uri(): void
"http://redirect.uri"
);

$this->assertEquals("http://redirect.url", $response->params->redirect_uri);
$this->assertEquals(
"http://redirect.uri",
$response->params->redirect_uri
);
}

public function test_android_package_name(): void
Expand Down

0 comments on commit f2571f7

Please sign in to comment.