/** * Wrap a template * @param Template $view * @return Template */ public function wrap(Template $view) { $template = $this->getTemplate(); $template->set('next', $view); if (!$this->wrapper) { return $template; } return $this->wrapper->wrap($template); }
public function testWrap() {/*{{{*/ $dir = dirname(__FILE__); $wrapper = new Wrapper; $xsltFile = $dir.'/demo.xslt'; $xmlFile = $dir.'/demo.xml'; $result = $wrapper->wrap($xsltFile, $xmlFile); $expectedRes = '<?xml version="1.0" encoding="gbk"?> <document> <item> <hospitalfacultyname>testÒ½Ôºtest¿Æ</hospitalfacultyname> <url>www.haodf.com</url> </item> </document>'; $resArray = XString::xmlToArray($result); $expectedResArray = XString::xmlToArray($expectedRes); $this->assertEquals($expectedResArray, $resArray); }/*}}}*/
function testAOP() { // test aop 测试入口 $aop = Wrapper::wrap(new AOPWorker()); $aop->testAOP(33347); }