setUpSmarty(__DIR__); } public function testInit() { $this->cleanDirs(); } /** * test unknown function error */ public function testUnknownFunction() { $this->smarty->enableSecurity(); try { $this->smarty->fetch('eval:{unknown()}'); } catch (Exception $e) { $this->assertStringContainsString("PHP function 'unknown' not allowed by security setting", $e->getMessage()); return; } $this->fail('Exception for unknown function has not been raised.'); } }