|
|
@@ -112,7 +112,6 @@ class ViewBuilderTest extends TestCase
|
|
|
public function arrayPropertyProvider(): array
|
|
|
{
|
|
|
return [
|
|
|
- ['helpers', ['Html', 'Form']],
|
|
|
['options', ['key' => 'value']],
|
|
|
];
|
|
|
}
|
|
|
@@ -211,6 +210,26 @@ class ViewBuilderTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Tests that adding non-assoc and assoc merge properly.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testAddHelpers(): void
|
|
|
+ {
|
|
|
+ $builder = new ViewBuilder();
|
|
|
+ $builder->addHelper('Form');
|
|
|
+ $builder->addHelpers(['Form' => ['config' => 'value']]);
|
|
|
+
|
|
|
+ $helpers = $builder->getHelpers();
|
|
|
+ $expected = [
|
|
|
+ 'Form' => [
|
|
|
+ 'config' => 'value',
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ $this->assertSame($expected, $helpers);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* test building with all the options.
|
|
|
*/
|
|
|
public function testBuildComplete(): void
|
|
|
@@ -431,9 +450,9 @@ class ViewBuilderTest extends TestCase
|
|
|
|
|
|
$helpers = $builder->getHelpers();
|
|
|
$expected = [
|
|
|
- 'Form',
|
|
|
- 'Time',
|
|
|
- 'Text',
|
|
|
+ 'Form' => [],
|
|
|
+ 'Time' => [],
|
|
|
+ 'Text' => [],
|
|
|
];
|
|
|
$this->assertSame($expected, $helpers);
|
|
|
}
|