Skip to content

Commit 9a00a57

Browse files
committed
Fix tests in CI
1 parent de0397a commit 9a00a57

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/integration/TestCase.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
use A17\Twill\Commands\Traits\HandlesPresets;
66
use A17\Twill\Models\User;
77
use A17\Twill\RouteServiceProvider;
8+
use A17\Twill\Services\Blocks\Block;
89
use A17\Twill\Tests\Integration\Behaviors\CopyBlocks;
10+
use A17\Twill\Facades\TwillBlocks;
911
use A17\Twill\TwillServiceProvider;
1012
use A17\Twill\ValidationServiceProvider;
1113
use Carbon\Carbon;
@@ -136,6 +138,7 @@ public function setUp(): void
136138
$this->instantiateFaker();
137139

138140
$this->copyBlocks();
141+
$this->registerCopiedBlocks();
139142

140143
$this->installTwill();
141144

@@ -558,6 +561,21 @@ public function loadConfig()
558561
{
559562
}
560563

564+
protected function registerCopiedBlocks(): void
565+
{
566+
if (Block::getForComponent('a17-block-quote')) {
567+
return;
568+
}
569+
570+
foreach (config('twill.block_editor.directories.source.blocks') as $path) {
571+
TwillBlocks::registerPackageBlocksDirectory($this->normalizeDir($path['path']));
572+
}
573+
574+
foreach (config('twill.block_editor.directories.source.repeaters') as $path) {
575+
TwillBlocks::registerPackageRepeatersDirectory($this->normalizeDir($path['path']));
576+
}
577+
}
578+
561579
protected static function getBasePathStatic(): string
562580
{
563581
$basePath = __DIR__ . '/../../vendor/orchestra/testbench-core/laravel';

0 commit comments

Comments
 (0)