-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimise test framework bunq/sdk_php#120 #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes.
tests/BunqSdkTestBase.php
Outdated
] | ||
); | ||
$avatarUuid = Avatar::create($attachmentUuid->getValue()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line can go
@@ -8,6 +8,7 @@ | |||
use bunq\Model\Generated\Object\Pointer; | |||
use bunq\test\BunqSdkTestBase; | |||
use bunq\test\Config; | |||
use phpDocumentor\Reflection\Types\This; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can go
@sandervdo please 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments @OGKevin
tests/BunqSdkTestBase.php
Outdated
] | ||
); | ||
$avatarUuid = Avatar::create($attachmentUuid->getValue()); | ||
$cashId = CashRegister::create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$cashRegisterId
foreach ($allAlias as $alias) { | ||
if ($alias->getType() === self::POINTER_TYPE_IBAN) { | ||
return $alias; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In open-source project explicit else is not needed. Only in bunq internal projects.
tests/BunqSdkTestBase.php
Outdated
*/ | ||
protected static function createApiContext(): ApiContext | ||
protected function getUserBravoPointer(): Pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPointerUserBravo
tests/BunqSdkTestBase.php
Outdated
/** | ||
* @return bool | ||
*/ | ||
protected function doesAccountHaveEnoughMoney(): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isMonetaryAccountBalanceSufficient
tests/BunqSdkTestBase.php
Outdated
{ | ||
if (!$this->doesAccountHaveEnoughMoney()) { | ||
static::markTestSkipped(self::WARMING_TEST_SKIPPED_DUE_TO_INSUFFICIENT_BALANCE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In open-source project explicit else is not needed. Only in bunq internal projects.
{ | ||
$this->assertTestShouldBeSkippedDueToInsufficientBalance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming seems weird. Asserting the test should be skipped?
/** | ||
* Tests the creation of a tab. | ||
* | ||
* This test and all its dependants have no assertion as of its testing to see if the code runs without errors. | ||
*/ | ||
public function testCreateTab() | ||
{ | ||
if (BunqContext::getUserContext()->isOnlyUserPersonSet()) { | ||
static::markTestSkipped('Only user company can create tabs.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In open-source project explicit else is not needed. Only in bunq internal projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, man, this switching between style guides... 😅
@sandervdo please 👀 again. |
This PR closes/fixes the following issues: