Page MenuHomePhorge

TestCase.php
No OneTemporary

Authored By
Unknown
Size
885 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();
}
}
/**
* 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, 10:08 AM (5 d, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
98/0f/5634a18b3d797d9b618b4dc92ebe
Default Alt Text
TestCase.php (885 B)

Event Timeline