assertSame('Hello Taylor', Blade::render('Hello {{ $name }}', ['name' => 'Taylor'])); } public function test_rendering_blade_long_maxpathlen_string() { $longString = str_repeat('a', PHP_MAXPATHLEN); $result = Blade::render($longString.'{{ $name }}', ['name' => 'a']); $this->assertSame($longString.'a', $result); } public function test_rendering_blade_component_instance() { $component = new HelloComponent('Taylor'); $this->assertSame('Hello Taylor', Blade::renderComponent($component)); } public function test_basic_blade_rendering() { $view = View::make('hello', ['name' => 'Taylor'])->render(); $this->assertSame('Hello Taylor', trim($view)); } public function test_rendering_a_component() { $view = View::make('uses-panel', ['name' => 'Taylor'])->render(); $this->assertSame('
Hello Taylor
', trim($view)); } public function test_rendering_a_dynamic_component() { $view = View::make('uses-panel-dynamically', ['name' => 'Taylor'])->render(); $this->assertSame('
Hello Taylor
', trim($view)); } public function test_rendering_the_same_dynamic_component_with_different_attributes() { $view = View::make('varied-dynamic-calls')->render(); $this->assertSame(' Hello Taylor Hello Samuel ', trim($view)); } public function test_inline_link_type_attributes_dont_add_extra_spacing_at_end() { $view = View::make('uses-link')->render(); $this->assertSame('This is a sentence with a link.', trim($view)); } public function test_appendable_attributes() { $view = View::make('uses-appendable-panel', ['name' => 'Taylor', 'withInjectedValue' => true])->render(); $this->assertSame('
Hello Taylor
', trim($view)); $view = View::make('uses-appendable-panel', ['name' => 'Taylor', 'withInjectedValue' => false])->render(); $this->assertSame('
Hello Taylor
', trim($view)); } public function tested_nested_anonymous_attribute_proxying_works_correctly() { $view = View::make('uses-child-input')->render(); $this->assertSame('', trim($view)); } public function test_consume_defaults() { $view = View::make('consume')->render(); $this->assertSame('

Menu

Slot: A, Color: orange, Default: foo
Slot: B, Color: red, Default: foo
Slot: C, Color: blue, Default: foo
Slot: D, Color: red, Default: foo
Slot: E, Color: red, Default: foo
Slot: F, Color: yellow, Default: foo
', trim($view)); } public function test_consume_with_props() { $view = View::make('consume', ['color' => 'rebeccapurple'])->render(); $this->assertSame('

Menu

Slot: A, Color: orange, Default: foo
Slot: B, Color: rebeccapurple, Default: foo
Slot: C, Color: blue, Default: foo
Slot: D, Color: rebeccapurple, Default: foo
Slot: E, Color: rebeccapurple, Default: foo
Slot: F, Color: yellow, Default: foo
', trim($view)); } protected function getEnvironmentSetUp($app) { $app['config']->set('view.paths', [__DIR__.'/templates']); } } class HelloComponent extends Component { public $name; public function __construct(string $name) { $this->name = $name; } public function render() { return 'Hello {{ $name }}'; } }