PMC-1218
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\unit\framework\src\Maveriks\Pattern\Mvc;
|
||||
|
||||
use Maveriks\Pattern\Mvc\SmartyView;
|
||||
use Smarty;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SmartyViewTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test the constructor of the SmartyView class
|
||||
*
|
||||
* @test
|
||||
*
|
||||
* @covers \Maveriks\Pattern\Mvc\SmartyView::__construct()
|
||||
*/
|
||||
public function it_should_test_the_class_constructor()
|
||||
{
|
||||
// Instance class SmartyView
|
||||
$smartyView = new SmartyView();
|
||||
|
||||
// Get "smarty" property
|
||||
$smartyInstance = $smartyView->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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user