MockedKernel example


class AppSnippetFileLoaderTest extends TestCase
{
    use AppSystemTestBehaviour;
    use IntegrationTestBehaviour;

    private SnippetFileLoader $snippetFileLoader;

    protected function setUp(): void
    {
        $this->snippetFileLoader = new SnippetFileLoader(
            new MockedKernel([]),
            $this->getContainer()->get(Connection::class),
            $this->getContainer()->get(AppSnippetFileLoader::class),
            $this->getContainer()->get(ActiveAppsLoader::class)
        );
    }

    public function testLoadSnippetFilesIntoCollectionWithoutSnippetFiles(): void
    {
        $this->loadAppsFromDir(__DIR__ . '/_fixtures/Apps/AppWithoutSnippets');

        $collection = new SnippetFileCollection();

        
use Shopware\Tests\Unit\Core\System\Snippet\Files\_fixtures\SnippetSet\SnippetSet;

/** * @internal * * @covers \Shopware\Core\System\Snippet\Files\SnippetFileLoader */
class SnippetFileLoaderTest extends TestCase
{
    public function testLoadSnippetsFromShopwareBundle(): void
    {
        $kernel = new MockedKernel(
            [
                'ShopwareBundleWithSnippets' => new ShopwareBundleWithSnippets(),
            ]
        );

        $collection = new SnippetFileCollection();

        $snippetFileLoader = new SnippetFileLoader(
            $kernel,
            $this->createMock(Connection::class),
            $this->createMock(AppSnippetFileLoader::class),
            
Home | Imprint | This part of the site doesn't use cookies.