@@ -142,6 +142,10 @@ class Mustache_Engine
|
|||||||
public function __construct(array $options = array())
|
public function __construct(array $options = array())
|
||||||
{
|
{
|
||||||
if (isset($options['template_class_prefix'])) {
|
if (isset($options['template_class_prefix'])) {
|
||||||
|
if ((string) $options['template_class_prefix'] === '') {
|
||||||
|
throw new Mustache_Exception_InvalidArgumentException('Mustache Constructor "template_class_prefix" must not be empty');
|
||||||
|
}
|
||||||
|
|
||||||
$this->templateClassPrefix = $options['template_class_prefix'];
|
$this->templateClassPrefix = $options['template_class_prefix'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,6 +158,16 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
|
|||||||
$this->assertNotSame($mustache->getCache(), $mustache->getProtectedLambdaCache());
|
$this->assertNotSame($mustache->getCache(), $mustache->getProtectedLambdaCache());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException Mustache_Exception_InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function testEmptyTemplatePrefixThrowsException()
|
||||||
|
{
|
||||||
|
new Mustache_Engine(array(
|
||||||
|
'template_class_prefix' => '',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Mustache_Exception_InvalidArgumentException
|
* @expectedException Mustache_Exception_InvalidArgumentException
|
||||||
* @dataProvider getBadEscapers
|
* @dataProvider getBadEscapers
|
||||||
|
|||||||
Reference in New Issue
Block a user