File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
tests/Foundation/Testing/Concerns Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace Illuminate \Tests \Foundation \Testing \Concerns ;
4
4
5
5
use Illuminate \Foundation \Testing \Concerns \InteractsWithViews ;
6
+ use Illuminate \View \Component ;
6
7
use Orchestra \Testbench \TestCase ;
7
8
8
9
class InteractsWithViewsTest extends TestCase
@@ -15,4 +16,19 @@ public function testBladeCorrectlyRendersString()
15
16
16
17
$ this ->assertEquals ('test ' , $ string );
17
18
}
19
+
20
+ public function testComponentCanAccessPublicProperties ()
21
+ {
22
+ $ exampleComponent = new class extends Component
23
+ {
24
+ public $ foo = 'bar ' ;
25
+ public function render ()
26
+ {
27
+ return '' ;
28
+ }
29
+ };
30
+ $ component = $ this ->component (get_class ($ exampleComponent ));
31
+
32
+ $ this ->assertEquals ('bar ' , $ component ->foo );
33
+ }
18
34
}
You can’t perform that action at this time.
0 commit comments