|
|
@@ -19,6 +19,7 @@ namespace Cake\Test\TestCase\View;
|
|
|
use Cake\Core\Exception\CakeException;
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
use Cake\View\StringTemplate;
|
|
|
+use InvalidArgumentException;
|
|
|
use RuntimeException;
|
|
|
use stdClass;
|
|
|
|
|
|
@@ -69,6 +70,19 @@ class StringTemplateTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * test adding a template config with a null value
|
|
|
+ */
|
|
|
+ public function testAddWithInvalidTemplate(): void
|
|
|
+ {
|
|
|
+ $templates = [
|
|
|
+ 'link' => '<a href="{{url}}">{{text}}</a>',
|
|
|
+ 'invalid' => null
|
|
|
+ ];
|
|
|
+ $this->expectException(InvalidArgumentException::class);
|
|
|
+ $this->template->add($templates);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Test remove.
|
|
|
*/
|
|
|
public function testRemove(): void
|