Page MenuHomePhorge

TestCase.php
No OneTemporary

Authored By
Unknown
Size
1010 B
Referenced Files
None
Subscribers
None

TestCase.php

<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use TestCaseTrait;
protected function backdateEntitlements($entitlements, $targetDate)
{
foreach ($entitlements as $entitlement) {
$entitlement->created_at = $targetDate;
$entitlement->updated_at = $targetDate;
$entitlement->save();
$owner = $entitlement->wallet->owner;
$owner->created_at = $targetDate;
$owner->save();
}
}
/**
* Set baseURL to the admin UI location
*/
protected static function useAdminUrl(): void
{
// This will set base URL for all tests in a file.
// If we wanted to access both user and admin in one test
// we can also just call post/get/whatever with full url
\config(['app.url' => str_replace('//', '//admin.', \config('app.url'))]);
url()->forceRootUrl(config('app.url'));
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 1:42 PM (1 d, 7 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18807201
Default Alt Text
TestCase.php (1010 B)

Event Timeline