Page MenuHomekolab.org

(An Untitled Masterwork)
ActivePublic

Authored by vanmeeuwen on Feb 26 2020, 2:08 PM.
```
public function testFifthWeek(): void
{
$entries = $this->changelogEntries($this->wallet);
$this->assertCount(4, $entries);
$targetDateA = Carbon::now()->subWeeks(5);
$targetDateB = $targetDateA->copy()->addMonths(1);
foreach ($entries as $entry) {
$entry->created_at = $targetDateA;
$entry->updated_at = $targetDateA;
$entry->save();
}
$this->assertEquals(999, $this->wallet->expectedCharges());
foreach ($this->wallet->entitlements as $entitlement) {
$entitlement->chargeWallet();
}
$this->wallet->refresh();
$this->assertEquals(-999, $this->wallet->balance);
$entries = $this->changelogEntries($this->wallet);
foreach ($entries as $entry) {
$this->assertTrue($entry->created_at->eq($targetDateA), "{$entry->created_at} != {$targetDateA}");
$this->assertTrue($entry->updated_at->eq($targetDateB), "{$entry->updated_at} != {$targetDateB}");
}
}
```
```
[vanmeeuwen@mws09 src (dev/billing *+% u+4)]$ > storage/logs/laravel-2020-02-26.log ; php -dzend_extension=xdebug.so vendor/bin/phpunit tests/Feature/BillingTest.php
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
F 1 / 1 (100%)
Time: 1.93 seconds, Memory: 26.00 MB
There was 1 failure:
1) Tests\Feature\BillingTest::testFifthWeek
2020-01-22 13:23:21 != 2020-01-22 13:23:21
Failed asserting that false is true.
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Feature/BillingTest.php:223
FAILURES!
Tests: 1, Assertions: 4, Failures: 1.
Generating code coverage report in HTML format ... done
[vanmeeuwen@mws09 src (dev/billing *+% u+4)]$ > storage/logs/laravel-2020-02-26.log ; php -dzend_extension=xdebug.so vendor/bin/phpunit tests/Feature/BillingTest.php
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
F 1 / 1 (100%)
Time: 1.63 seconds, Memory: 26.00 MB
There was 1 failure:
1) Tests\Feature\BillingTest::testFifthWeek
2020-02-22 13:24:59 != 2020-02-22 13:24:59
Failed asserting that false is true.
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Feature/BillingTest.php:224
FAILURES!
Tests: 1, Assertions: 4, Failures: 1.
Generating code coverage report in HTML format ... done
```

Event Timeline

vanmeeuwen created this paste.Feb 26 2020, 2:08 PM
vanmeeuwen edited the content of this paste. (Show Details)Feb 26 2020, 2:25 PM