File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,28 @@ public function it_resolves_callback_to_html_code(): void
1515
1616 $ this ->assertSame ('<p>Hello!</p> ' , $ field ->meta ()['html ' ] ?? null );
1717 }
18+
19+ /** @test */
20+ public function it_accepts_array_as_config (): void
21+ {
22+ $ field = new Unlayer ('any_name ' );
23+
24+ $ field ->config (['projectId ' => 'XXX ' ]);
25+
26+ $ this ->assertArrayHasKey ('projectId ' , $ field ->meta ()['config ' ]);
27+ $ this ->assertSame ('XXX ' , $ field ->meta ()['config ' ]['projectId ' ]);
28+ }
29+
30+ /** @test */
31+ public function it_accepts_callable_as_config (): void
32+ {
33+ $ field = new Unlayer ('any_name ' );
34+
35+ $ field ->config (function () {
36+ return ['projectId ' => 'XXX ' ];
37+ });
38+
39+ $ this ->assertArrayHasKey ('projectId ' , $ field ->meta ()['config ' ]);
40+ $ this ->assertSame ('XXX ' , $ field ->meta ()['config ' ]['projectId ' ]);
41+ }
1842}
You can’t perform that action at this time.
0 commit comments