diff --git a/tests/View/ComponentTest.php b/tests/View/ComponentTest.php index 87e716edcee7..4a7a59253000 100644 --- a/tests/View/ComponentTest.php +++ b/tests/View/ComponentTest.php @@ -130,7 +130,7 @@ public function testRegularViewNamesGetReturned() $this->assertSame('alert', $component->resolveView()); } - public function testHtmlablesGetReturned() + public function testHtmlableGetReturned() { $component = new TestHtmlableReturningViewComponent; @@ -187,9 +187,14 @@ public function testResolveComponentsUsing() { $component = new TestInlineViewComponent; - Component::resolveComponentsUsing(fn () => $component); + Component::resolveComponentsUsing(function ($class, $data) use ($component) { + $this->assertSame(Component::class, $class, 'It takes the component class name as the first parameter.'); + $this->assertSame(['foo' => 'bar'], $data, 'It takes the given data as the second parameter.'); - $this->assertSame($component, Component::resolve('bar')); + return $component; + }); + + $this->assertSame($component, Component::resolve(['foo' => 'bar'])); } public function testBladeViewCacheWithRegularViewNameViewComponent()