mirror of
https://github.com/pestphp/pest.git
synced 2026-03-13 03:07:22 +01:00
Add support for installing Pest into a Lumen application
This entails creating Laravel and Lumen-specific stubs, and ensuring that the appropriate stubs are copied as part of the pest install.
This commit is contained in:
12
stubs/Laravel/Helpers.php
Normal file
12
stubs/Laravel/Helpers.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Set the currently logged in user for the application.
|
||||
*/
|
||||
function actingAs(Authenticatable $user, string $driver = null): TestCase
|
||||
{
|
||||
return test()->actingAs($user, $driver);
|
||||
}
|
||||
3
stubs/Laravel/Pest.php
Normal file
3
stubs/Laravel/Pest.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
uses(Tests\TestCase::class)->in('Feature');
|
||||
21
stubs/Laravel/phpunit.xml
Normal file
21
stubs/Laravel/phpunit.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./app</directory>
|
||||
<directory suffix=".php">./src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
Reference in New Issue
Block a user