• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 17738646910

15 Sep 2025 03:40PM UTC coverage: 22.156% (-0.07%) from 22.227%
17738646910

Pull #7380

github

web-flow
Merge e3d95e940 into 4abec444e
Pull Request #7380: fix(laravel): http cache compatibility

0 of 152 new or added lines in 9 files covered. (0.0%)

4 existing lines in 4 files now uncovered.

11127 of 50221 relevant lines covered (22.16%)

23.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Laravel/workbench/app/Providers/WorkbenchServiceProvider.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace Workbench\App\Providers;
15

16
use Illuminate\Console\OutputStyle;
17
use Illuminate\Console\View\Components\Factory;
18
use Illuminate\Filesystem\Filesystem;
19
use Illuminate\Support\ServiceProvider;
20
use Orchestra\Testbench\Foundation\Events\ServeCommandStarted;
21
use Orchestra\Testbench\Workbench\Actions\AddAssetSymlinkFolders;
22
use Orchestra\Testbench\Workbench\Workbench;
23
use Symfony\Component\Console\Input\ArrayInput;
24
use Symfony\Component\Console\Output\NullOutput;
25
use Workbench\App\Purger\MockPurger;
26
use Workbench\App\Services\DummyService;
27
use Workbench\App\State\CustomProviderWithDependency;
28

29
class WorkbenchServiceProvider extends ServiceProvider
30
{
31
    /**
32
     * Register services.
33
     */
34
    public function register(): void
35
    {
36
        $config = $this->app['config'];
×
37
        $config->set('api-platform.resources', [app_path('Models'), app_path('ApiResource')]);
×
NEW
38
        $config->set('api-platform.http_cache.invalidation.purger', MockPurger::class);
×
UNCOV
39
        $config->set('cache.default', 'null');
×
40

NEW
41
        $this->app->singleton(MockPurger::class, fn ($app) => new MockPurger());
×
42
        $this->app->singleton(DummyService::class, fn ($app) => new DummyService($app['config']->get('api-platform.title')));
×
43
        $this->app->singleton(CustomProviderWithDependency::class, fn ($app) => new CustomProviderWithDependency($app->make(DummyService::class)));
×
44
    }
45

46
    /**
47
     * Bootstrap services.
48
     */
49
    public function boot(): void
50
    {
51
        $assets = new AddAssetSymlinkFolders($this->app->make(Filesystem::class), Workbench::configuration());
×
52
        $input = new ArrayInput([]);
×
53
        $output = new NullOutput();
×
54
        $assets->handle(new ServeCommandStarted($input, $output, new Factory(new OutputStyle($input, $output))));
×
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc