@@ -31,9 +31,9 @@ public function testBasicComponentParsing()
31
31
32
32
$ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
33
33
<?php \$component->withAttributes(['type' => 'foo','limit' => '5','@click' => 'foo','required' => true]); ?>
34
- @endcomponentClass @component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
34
+ @endcomponentClass @component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
35
35
<?php \$component->withAttributes([]); ?>
36
- @endcomponentClass</div> " , trim ($ result ));
36
+ @endcomponentClass </div> " , trim ($ result ));
37
37
}
38
38
39
39
public function testBasicComponentWithEmptyAttributesParsing ()
@@ -42,7 +42,7 @@ public function testBasicComponentWithEmptyAttributesParsing()
42
42
43
43
$ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
44
44
<?php \$component->withAttributes(['type' => '','limit' => '','@click' => '','required' => true]); ?>
45
- @endcomponentClass</div> " , trim ($ result ));
45
+ @endcomponentClass </div> " , trim ($ result ));
46
46
}
47
47
48
48
public function testDataCamelCasing ()
@@ -91,7 +91,7 @@ public function testSelfClosingComponentsCanBeCompiled()
91
91
92
92
$ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
93
93
<?php \$component->withAttributes([]); ?>
94
- @endcomponentClass</div> " , trim ($ result ));
94
+ @endcomponentClass </div> " , trim ($ result ));
95
95
}
96
96
97
97
public function testClassNamesCanBeGuessed ()
@@ -140,6 +140,23 @@ public function testSelfClosingComponentsCanBeCompiledWithDataAndAttributes()
140
140
@endcomponentClass " , trim ($ result ));
141
141
}
142
142
143
+ public function testComponentsCanHaveAttachedWord ()
144
+ {
145
+ $ result = (new ComponentTagCompiler (['profile ' => TestProfileComponent::class]))->compileTags ('<x-profile></x-profile>Words ' );
146
+
147
+ $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', [])
148
+ <?php \$component->withAttributes([]); ?> @endcomponentClass Words " , trim ($ result ));
149
+ }
150
+
151
+ public function testSelfClosingComponentsCanHaveAttachedWord ()
152
+ {
153
+ $ result = (new ComponentTagCompiler (['alert ' => TestAlertComponent::class]))->compileTags ('<x-alert/>Words ' );
154
+
155
+ $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', [])
156
+ <?php \$component->withAttributes([]); ?>
157
+ @endcomponentClass Words " , trim ($ result ));
158
+ }
159
+
143
160
public function testSelfClosingComponentsCanBeCompiledWithBoundData ()
144
161
{
145
162
$ result = (new ComponentTagCompiler (['alert ' => TestAlertComponent::class]))->compileTags ('<x-alert :title="$title" class="bar" /> ' );
0 commit comments