@@ -40,69 +40,69 @@ public function testBasicComponentParsing()
4040
4141 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<div><x-alert type="foo" limit="5" @click="foo" wire:click="changePlan( \'{{ $plan }} \')" required /><x-alert /></div> ' );
4242
43- $ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
43+ $ this ->assertSame ("<div>##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
4444<?php \$component->withAttributes(['type' => 'foo','limit' => '5','@click' => 'foo','wire:click' => 'changePlan(\''.e( \$plan).'\')','required' => true]); ?> \n" .
45- "@endcomponentClass @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
45+ "@endComponentClass##END-COMPONENT-CLASS####BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
4646<?php \$component->withAttributes([]); ?> \n" .
47- '@endcomponentClass </div> ' , trim ($ result ));
47+ '@endComponentClass##END-COMPONENT-CLASS## </div> ' , trim ($ result ));
4848 }
4949
5050 public function testBasicComponentWithEmptyAttributesParsing ()
5151 {
5252 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<div><x-alert type="" limit= \'\' @click="" required /></div> ' );
5353
54- $ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
54+ $ this ->assertSame ("<div>##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
5555<?php \$component->withAttributes(['type' => '','limit' => '','@click' => '','required' => true]); ?> \n" .
56- '@endcomponentClass </div> ' , trim ($ result ));
56+ '@endComponentClass##END-COMPONENT-CLASS## </div> ' , trim ($ result ));
5757 }
5858
5959 public function testDataCamelCasing ()
6060 {
6161 $ result = $ this ->compiler (['profile ' => TestProfileComponent::class])->compileTags ('<x-profile user-id="1"></x-profile> ' );
6262
63- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', ['userId' => '1'])
64- <?php \$component->withAttributes([]); ?> @endcomponentClass " , trim ($ result ));
63+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', ['userId' => '1'])
64+ <?php \$component->withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
6565 }
6666
6767 public function testColonData ()
6868 {
6969 $ result = $ this ->compiler (['profile ' => TestProfileComponent::class])->compileTags ('<x-profile :user-id="1"></x-profile> ' );
7070
71- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', ['userId' => 1])
72- <?php \$component->withAttributes([]); ?> @endcomponentClass " , trim ($ result ));
71+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', ['userId' => 1])
72+ <?php \$component->withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
7373 }
7474
7575 public function testColonAttributesIsEscapedIfStrings ()
7676 {
7777 $ result = $ this ->compiler (['profile ' => TestProfileComponent::class])->compileTags ('<x-profile :src=" \'foo \'"></x-profile> ' );
7878
79- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
80- <?php \$component->withAttributes(['src' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('foo')]); ?> @endcomponentClass " , trim ($ result ));
79+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
80+ <?php \$component->withAttributes(['src' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('foo')]); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
8181 }
8282
8383 public function testColonNestedComponentParsing ()
8484 {
8585 $ result = $ this ->compiler (['foo:alert ' => TestAlertComponent::class])->compileTags ('<x-foo:alert></x-foo:alert> ' );
8686
87- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'foo:alert', [])
88- <?php \$component->withAttributes([]); ?> @endcomponentClass " , trim ($ result ));
87+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'foo:alert', [])
88+ <?php \$component->withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
8989 }
9090
9191 public function testColonStartingNestedComponentParsing ()
9292 {
9393 $ result = $ this ->compiler (['foo:alert ' => TestAlertComponent::class])->compileTags ('<x:foo:alert></x-foo:alert> ' );
9494
95- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'foo:alert', [])
96- <?php \$component->withAttributes([]); ?> @endcomponentClass " , trim ($ result ));
95+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'foo:alert', [])
96+ <?php \$component->withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
9797 }
9898
9999 public function testSelfClosingComponentsCanBeCompiled ()
100100 {
101101 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<div><x-alert/></div> ' );
102102
103- $ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
103+ $ this ->assertSame ("<div>##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
104104<?php \$component->withAttributes([]); ?> \n" .
105- '@endcomponentClass </div> ' , trim ($ result ));
105+ '@endComponentClass##END-COMPONENT-CLASS## </div> ' , trim ($ result ));
106106 }
107107
108108 public function testClassNamesCanBeGuessed ()
@@ -139,27 +139,27 @@ public function testComponentsCanBeCompiledWithHyphenAttributes()
139139
140140 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<x-alert class="bar" wire:model="foo" x-on:click="bar" @click="baz" /> ' );
141141
142- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
142+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
143143<?php \$component->withAttributes(['class' => 'bar','wire:model' => 'foo','x-on:click' => 'bar','@click' => 'baz']); ?> \n" .
144- '@endcomponentClass ' , trim ($ result ));
144+ '@endComponentClass##END-COMPONENT-CLASS## ' , trim ($ result ));
145145 }
146146
147147 public function testSelfClosingComponentsCanBeCompiledWithDataAndAttributes ()
148148 {
149149 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<x-alert title="foo" class="bar" wire:model="foo" /> ' );
150150
151- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => 'foo'])
151+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => 'foo'])
152152<?php \$component->withAttributes(['class' => 'bar','wire:model' => 'foo']); ?> \n" .
153- '@endcomponentClass ' , trim ($ result ));
153+ '@endComponentClass##END-COMPONENT-CLASS## ' , trim ($ result ));
154154 }
155155
156156 public function testComponentCanReceiveAttributeBag ()
157157 {
158158 $ this ->mockViewFactory ();
159159 $ result = $ this ->compiler (['profile ' => TestProfileComponent::class])->compileTags ('<x-profile class="bar" {{ $attributes }} wire:model="foo"></x-profile> ' );
160160
161- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
162- <?php \$component->withAttributes(['class' => 'bar','attributes' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute( \$attributes),'wire:model' => 'foo']); ?> @endcomponentClass " , trim ($ result ));
161+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
162+ <?php \$component->withAttributes(['class' => 'bar','attributes' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute( \$attributes),'wire:model' => 'foo']); ?> @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
163163 }
164164
165165 public function testSelfClosingComponentCanReceiveAttributeBag ()
@@ -168,45 +168,45 @@ public function testSelfClosingComponentCanReceiveAttributeBag()
168168
169169 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<div><x-alert title="foo" class="bar" {{ $attributes->merge([ \'class \' => \'test \']) }} wire:model="foo" /></div> ' );
170170
171- $ this ->assertSame ("<div> @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => 'foo'])
171+ $ this ->assertSame ("<div>##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => 'foo'])
172172<?php \$component->withAttributes(['class' => 'bar','attributes' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute( \$attributes->merge(['class' => 'test'])),'wire:model' => 'foo']); ?> \n" .
173- '@endcomponentClass </div> ' , trim ($ result ));
173+ '@endComponentClass##END-COMPONENT-CLASS## </div> ' , trim ($ result ));
174174 }
175175
176176 public function testComponentsCanHaveAttachedWord ()
177177 {
178178 $ result = $ this ->compiler (['profile ' => TestProfileComponent::class])->compileTags ('<x-profile></x-profile>Words ' );
179179
180- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
181- <?php \$component->withAttributes([]); ?> @endcomponentClass Words " , trim ($ result ));
180+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestProfileComponent', 'profile', [])
181+ <?php \$component->withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS## Words " , trim ($ result ));
182182 }
183183
184184 public function testSelfClosingComponentsCanHaveAttachedWord ()
185185 {
186186 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<x-alert/>Words ' );
187187
188- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
188+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
189189<?php \$component->withAttributes([]); ?> \n" .
190- '@endcomponentClass Words ' , trim ($ result ));
190+ '@endComponentClass##END-COMPONENT-CLASS## Words ' , trim ($ result ));
191191 }
192192
193193 public function testSelfClosingComponentsCanBeCompiledWithBoundData ()
194194 {
195195 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<x-alert :title="$title" class="bar" /> ' );
196196
197- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => \$title])
197+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', ['title' => \$title])
198198<?php \$component->withAttributes(['class' => 'bar']); ?> \n" .
199- '@endcomponentClass ' , trim ($ result ));
199+ '@endComponentClass##END-COMPONENT-CLASS## ' , trim ($ result ));
200200 }
201201
202202 public function testPairedComponentTags ()
203203 {
204204 $ result = $ this ->compiler (['alert ' => TestAlertComponent::class])->compileTags ('<x-alert>
205205</x-alert> ' );
206206
207- $ this ->assertSame ("@component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
207+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\Tests\View\Blade\TestAlertComponent', 'alert', [])
208208<?php \$component->withAttributes([]); ?>
209- @endcomponentClass " , trim ($ result ));
209+ @endComponentClass##END-COMPONENT-CLASS## " , trim ($ result ));
210210 }
211211
212212 public function testClasslessComponents ()
@@ -220,9 +220,9 @@ public function testClasslessComponents()
220220
221221 $ result = $ this ->compiler ()->compileTags ('<x-anonymous-component :name=" \'Taylor \'" :age="31" wire:model="foo" /> ' );
222222
223- $ this ->assertSame ("@component('Illuminate\View\AnonymousComponent', 'anonymous-component', ['view' => 'components.anonymous-component','data' => ['name' => 'Taylor','age' => 31,'wire:model' => 'foo']])
223+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\View\AnonymousComponent', 'anonymous-component', ['view' => 'components.anonymous-component','data' => ['name' => 'Taylor','age' => 31,'wire:model' => 'foo']])
224224<?php \$component->withAttributes(['name' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('Taylor'),'age' => 31,'wire:model' => 'foo']); ?> \n" .
225- '@endcomponentClass ' , trim ($ result ));
225+ '@endComponentClass##END-COMPONENT-CLASS## ' , trim ($ result ));
226226 }
227227
228228 public function testPackagesClasslessComponents ()
@@ -236,9 +236,9 @@ public function testPackagesClasslessComponents()
236236
237237 $ result = $ this ->compiler ()->compileTags ('<x-package::anonymous-component :name=" \'Taylor \'" :age="31" wire:model="foo" /> ' );
238238
239- $ this ->assertSame ("@component('Illuminate\View\AnonymousComponent', 'package::anonymous-component', ['view' => 'package::components.anonymous-component','data' => ['name' => 'Taylor','age' => 31,'wire:model' => 'foo']])
239+ $ this ->assertSame ("##BEGIN-COMPONENT-CLASS## @component('Illuminate\View\AnonymousComponent', 'package::anonymous-component', ['view' => 'package::components.anonymous-component','data' => ['name' => 'Taylor','age' => 31,'wire:model' => 'foo']])
240240<?php \$component->withAttributes(['name' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('Taylor'),'age' => 31,'wire:model' => 'foo']); ?> \n" .
241- '@endcomponentClass ' , trim ($ result ));
241+ '@endComponentClass##END-COMPONENT-CLASS## ' , trim ($ result ));
242242 }
243243
244244 public function testAttributeSanitization ()
0 commit comments