Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/WalletTest.php
Show All 34 Lines | class WalletTest extends TestCase | ||||
{ | { | ||||
foreach ($this->users as $user) { | foreach ($this->users as $user) { | ||||
$this->deleteTestUser($user); | $this->deleteTestUser($user); | ||||
} | } | ||||
parent::tearDown(); | parent::tearDown(); | ||||
} | } | ||||
public function testCostsPerDay(): void | |||||
{ | |||||
// 999 | |||||
// 28 days: 35.68 | |||||
// 31 days: 32.22 | |||||
$user = $this->getTestUser('jane@kolabnow.com'); | |||||
$package = Package::where('title', 'kolab')->first(); | |||||
$mailbox = Sku::where('title', 'mailbox')->first(); | |||||
$user->assignPackage($package); | |||||
$wallet = $user->wallets()->first(); | |||||
$costsPerDay = $wallet->costsPerDay(); | |||||
$this->assertTrue($costsPerDay < 35.68); | |||||
$this->assertTrue($costsPerDay > 32.22); | |||||
} | |||||
/** | /** | ||||
* Verify a wallet is created, when a user is created. | * Verify a wallet is created, when a user is created. | ||||
*/ | */ | ||||
public function testCreateUserCreatesWallet(): void | public function testCreateUserCreatesWallet(): void | ||||
{ | { | ||||
$user = $this->getTestUser('UserWallet1@UserWallet.com'); | $user = $this->getTestUser('UserWallet1@UserWallet.com'); | ||||
$this->assertCount(1, $user->wallets); | $this->assertCount(1, $user->wallets); | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |