diff --git a/framework/src/Maveriks/Pattern/Mvc/SmartyView.php b/framework/src/Maveriks/Pattern/Mvc/SmartyView.php index 94620fe07..647a8ad38 100644 --- a/framework/src/Maveriks/Pattern/Mvc/SmartyView.php +++ b/framework/src/Maveriks/Pattern/Mvc/SmartyView.php @@ -38,6 +38,16 @@ class SmartyView extends View } } + /** + * Get "smarty" property + * + * @return Smarty + */ + public function getSmarty() + { + return $this->smarty; + } + /** * Assign a value to a Smarty piece in the template * diff --git a/tests/unit/framework/src/Maveriks/Pattern/Mvc/SmartyViewTest.php b/tests/unit/framework/src/Maveriks/Pattern/Mvc/SmartyViewTest.php new file mode 100644 index 000000000..4c17a5ec0 --- /dev/null +++ b/tests/unit/framework/src/Maveriks/Pattern/Mvc/SmartyViewTest.php @@ -0,0 +1,33 @@ +getSmarty(); + + // Assert correct class instance + $this->assertInstanceOf(Smarty::class, $smartyInstance); + + // Assert that the required folders exist + $this->assertDirectoryExists($smartyInstance->compile_dir); + $this->assertDirectoryExists($smartyInstance->cache_dir); + } +}