Skip to content

Commit f29d3d5

Browse files
committed
pest support
1 parent b17424e commit f29d3d5

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

phpunit.xml.dist

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
55
backupGlobals="false"
66
bootstrap="vendor/autoload.php"
77
colors="true"
@@ -16,23 +16,14 @@
1616
backupStaticProperties="false"
1717
>
1818
<testsuites>
19-
<testsuite name="VendorName Test Suite">
20-
<directory>tests</directory>
19+
<testsuite name="Test Suite">
20+
<directory suffix="Test.php">./tests</directory>
2121
</testsuite>
2222
</testsuites>
23-
<coverage>
24-
<report>
25-
<html outputDirectory="build/coverage"/>
26-
<text outputFile="build/coverage.txt"/>
27-
<clover outputFile="build/logs/clover.xml"/>
28-
</report>
29-
</coverage>
30-
<logging>
31-
<junit outputFile="build/report.junit.xml"/>
32-
</logging>
3323
<source>
3424
<include>
25+
<directory suffix=".php">./app</directory>
3526
<directory suffix=".php">./src</directory>
3627
</include>
3728
</source>
38-
</phpunit>
29+
</phpunit>

tests/TestCase.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
use Filament\Tables\TablesServiceProvider;
1414
use Filament\Widgets\WidgetsServiceProvider;
1515
use Illuminate\Database\Eloquent\Factories\Factory;
16-
use Illuminate\Foundation\Testing\TestResponse;
16+
use Illuminate\Database\Schema\Blueprint;
17+
use Illuminate\Support\Facades\Schema;
18+
use Illuminate\Testing\TestResponse;
1719
use Livewire\LivewireServiceProvider;
1820
use Orchestra\Testbench\TestCase as Orchestra;
1921
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider;
@@ -60,6 +62,14 @@ public function getEnvironmentSetUp($app)
6062
{
6163
config()->set('database.default', 'testing');
6264

65+
// Create users table first (required by library migrations)
66+
Schema::create('users', function (Blueprint $table) {
67+
$table->id();
68+
$table->string('name');
69+
$table->string('email')->unique();
70+
$table->timestamps();
71+
});
72+
6373
// Run the library migrations
6474
$migration = include __DIR__ . '/../database/migrations/2024_01_01_000000_create_library_items_table.php';
6575
$migration->up();

0 commit comments

Comments
 (0)