assertSame('startComponent(\'foo\', ["foo" => "bar"]); ?>', $this->compiler->compileString('@component(\'foo\', ["foo" => "bar"])')); $this->assertSame('startComponent(\'foo\'); ?>', $this->compiler->compileString('@component(\'foo\')')); } public function testClassComponentsAreCompiled() { $this->assertSame(' getContainer()->make(Test::class, ["foo" => "bar"]); ?> withName(\'test\'); ?> shouldRender()): ?> startComponent($component->resolveView(), $component->data()); ?>', $this->compiler->compileString('@component(\'Test::class\', \'test\', ["foo" => "bar"])')); } public function testEndComponentsAreCompiled() { $this->compiler->newComponentHash('foo'); $this->assertSame('renderComponent(); ?>', $this->compiler->compileString('@endcomponent')); } public function testEndComponentClassesAreCompiled() { $this->compiler->newComponentHash('foo'); $this->assertSame('renderComponent(); ?> ', $this->compiler->compileString('@endcomponentClass')); } public function testSlotsAreCompiled() { $this->assertSame('slot(\'foo\', null, ["foo" => "bar"]); ?>', $this->compiler->compileString('@slot(\'foo\', null, ["foo" => "bar"])')); $this->assertSame('slot(\'foo\'); ?>', $this->compiler->compileString('@slot(\'foo\')')); } public function testEndSlotsAreCompiled() { $this->assertSame('endSlot(); ?>', $this->compiler->compileString('@endslot')); } }