apility/test-utilities

v0.0.13 2021-11-05 12:15 UTC

This package is auto-updated.

Last update: 2024-12-05 19:28:53 UTC


README

This is a simple utility library for bootstrapping a minimal Laravel like container.

This can be used to test your Laravel packages without bootstrapping a full Laravel instance. You just specify upfront what config and service providers to load, and this library takes care of the rest.

Installation

composer require apility/test-utilities

Example

use Apility\Testing\Laravel;

$app = Laravel::createApplication()
    ->withRoot(__DIR__)
    ->withConfig([
        'cache' => [
            'default' => 'file',
            'stores' => [
                'file' => [
                    'driver' => 'file',
                    'path' => __DIR__ . '/cache',
                ],
            ],
        ],
    ])
    ->withFrameworkProvider(Illuminate\Cache\CacheServiceProvider::class)
    ->withProvider(MyPlugin\Providers\MyPluginServiceProvider::class)
    ->boot();