-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Description
- Laravel Version: 9.36.2
- PHP Version: 8.1.11
Description:
- run the whole file, the last test will fail with
InvalidArgumentException : No hint path defined for [__components]. - running only the
will failtest will create a invalid blade file and fail withIlluminate\View\ViewException : syntax error, unexpected token "endif", expecting end of file
<?php $__env->startComponent('SomeElement', 'some-element', []); ?>
<?php if (isset($attributes) && $constructor = (new ReflectionClass(SomeElement::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?> <?php /** THERE IS NO OPEN IF **/ ?>
<?php if (isset($__componentOriginal0cbfd81d34ff16f0868c01a1a16dfeb994e92c1e)): ?>
<?php $component = $__componentOriginal0cbfd81d34ff16f0868c01a1a16dfeb994e92c1e; ?>
<?php unset($__componentOriginal0cbfd81d34ff16f0868c01a1a16dfeb994e92c1e); ?>
<?php endif; ?><?php /**PATH /.../storage/framework/views/1f84f403095fcf086e9a69cc809736581405d651.blade.php ENDPATH**/ ?>Steps To Reproduce:
Create a Pest Test File
<?php
use Illuminate\Support\Facades\Blade;
use Illuminate\View\Component;
class SomeElement extends Component
{
public function render()
{
return '<div></div>';
}
}
it('works', function() {
Blade::renderComponent(new SomeElement);
$this->assertTrue(true);
});
it('will fail', function() {
Blade::component(SomeElement::class, 'some-element');
Blade::render('<x-some-element />');
$this->assertTrue(true);
});ConnySjoblom and trovster
Metadata
Metadata
Assignees
Labels
No labels