Page MenuHomePhorge

TestCase.php
No OneTemporary

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
Sun, Sep 14, 2:13 AM (30 m, 31 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
287317
Default Alt Text
TestCase.php (1010 B)

Event Timeline