public function testView() { $content = <<<HTML <!doctype html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <h1><?=\$this->v['title']?></h1> </body> </html> HTML; $tpl = __DIR__ . '/test.phtml'; file_put_contents($tpl, $content); $view = new \wisphp\web\view\WisView(); $title = "中国人的标题"; $view->set('title', $title); $content = $view->build($tpl); $tplContent = <<<HTML <!doctype html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <h1>{$title}</h1> </body> </html> HTML; $this->assertEquals($content, $tplContent); }