HEX
Server: Apache
System: Linux webm013.cluster123.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: lesanew (165608)
PHP: 8.3.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/l/e/s/lesanew/anestetues2/vendor/roots/acorn/tests/Assets/BudCompatibilityTest.php
<?php

use Roots\Acorn\Assets\Bundle;
use Roots\Acorn\Tests\Test\TestCase;

uses(TestCase::class);

beforeEach(fn () => Bundle::resetInlinedSources());

it('supports bud v6: build', function () {
    $manifest = json_decode(file_get_contents($this->fixture('bud_v6_single_runtime/public/entrypoints.json')), JSON_OBJECT_AS_ARRAY);
    $app = new Bundle('app', $manifest['app'], $this->fixture('bud_v6_single_runtime/public'), 'https://k.jo/public');
    $editor = new Bundle('editor', $manifest['editor'], $this->fixture('bud_v6_single_runtime/public'), 'https://k.jo/public');

    $this->stub('wp_add_inline_script')
        ->shouldBeCalled()
        ->once()
        ->withAnyArgs();

    $this->stub('wp_enqueue_script')
        ->shouldBeCalled()
        ->times(4)
        ->withAnyArgs();

    $app->enqueueJs();
    $editor->enqueueJs();
});

it('supports bud v6: build --esm', function () {
    $manifest = json_decode(file_get_contents($this->fixture('bud_v6_single_runtime_esm/public/entrypoints.json')), JSON_OBJECT_AS_ARRAY);
    $app = new Bundle('app', $manifest['app'], $this->fixture('bud_v6_single_runtime_esm/public'), 'https://k.jo/public');
    $editor = new Bundle('editor', $manifest['editor'], $this->fixture('bud_v6_single_runtime_esm/public'), 'https://k.jo/public');

    $this->stub('wp_add_inline_script')
        ->shouldBeCalled()
        ->once()
        ->withAnyArgs();

    $this->stub('wp_enqueue_script')
        ->shouldBeCalled()
        ->times(4)
        ->withAnyArgs();

    $app->enqueueJs();
    $editor->enqueueJs();
});

it('supports bud v6: dev', function () {
    $manifest = json_decode(file_get_contents($this->fixture('bud_v6_single_runtime_hmr/public/entrypoints.json')), JSON_OBJECT_AS_ARRAY);
    $app = new Bundle('app', $manifest['app'], $this->fixture('bud_v6_single_runtime_hmr/public'), 'https://k.jo/public');
    $editor = new Bundle('editor', $manifest['editor'], $this->fixture('bud_v6_single_runtime_hmr/public'), 'https://k.jo/public');

    $this->stub('wp_add_inline_script')
        ->shouldBeCalled()
        ->never();

    $this->stub('wp_enqueue_script')
        ->shouldBeCalled()
        ->times(2)
        ->withAnyArgs();

    $app->enqueueJs();
    $editor->enqueueJs();
});

it('supports bud v6: dev --esm', function () {
    $manifest = json_decode(file_get_contents($this->fixture('bud_v6_single_runtime_hmr_esm/public/entrypoints.json')), JSON_OBJECT_AS_ARRAY);
    $app = new Bundle('app', $manifest['app'], $this->fixture('bud_v6_single_runtime_hmr_esm/public'), 'https://k.jo/public');
    $editor = new Bundle('editor', $manifest['editor'], $this->fixture('bud_v6_single_runtime_hmr_esm/public'), 'https://k.jo/public');

    $this->stub('wp_add_inline_script')
        ->shouldBeCalled()
        ->never();

    $this->stub('wp_enqueue_script')
        ->shouldBeCalled()
        ->times(2)
        ->withAnyArgs();

    $app->enqueueJs();
    $editor->enqueueJs();
});