* @license PHP License * @package WB * @subpackage unittest */ /** * Unit Test * * * * @version 0.1.0 * @package WB * @subpackage unittest */ class TestCasePatTemplateBase extends UnitTestCase { /** * worker * @var patTemplate */ protected $_tmpl; /** * error reporting level * @var int */ protected $_oldErrorReportingLevel; /** * set up error reporting level */ public function __construct() { $this->_oldErrorReportingLevel = error_reporting( E_ALL ); $this->_tmpl = WBClass::create( 'patTemplate' ); } /** * set up error reporting level */ public function setUp() { error_reporting( E_ALL ); } /** * reset error reporting level */ public function tearDown() { error_reporting( $this->_oldErrorReportingLevel ); } /** * load class and start */ public function testInit() { $this->assertTrue( class_exists( 'patTemplate', false ) ); $this->assertIsA( $this->_tmpl, 'patTemplate' ); } /** * use special template "load.tmpl" * * */ public function testLoad() { $this->_tmpl->readTemplatesFRomInput( 'test/load.tmpl' ); $this->assertEqual( $this->_tmpl->getParsedTemplate( 'load01' ), 'unittest' ); $this->assertEqual( $this->_tmpl->getParsedTemplate( 'load02' ), 'unittest' ); $this->assertEqual( $this->_tmpl->getParsedTemplate( 'load03' ), 'unit{THIS_VAR_IS_NOT_SET}test' ); } } ?>