mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
修正单元测试错误
This commit is contained in:
@@ -566,7 +566,7 @@ class Cx extends Taglib
|
|||||||
} else {
|
} else {
|
||||||
// 命名空间导入模式 默认是js
|
// 命名空间导入模式 默认是js
|
||||||
$type = $type ? $type : (!empty($tag['type']) ? strtolower($tag['type']) : 'js');
|
$type = $type ? $type : (!empty($tag['type']) ? strtolower($tag['type']) : 'js');
|
||||||
$basepath = !empty($tag['basepath']) ? $tag['basepath'] : __ROOT__ . '/Public';
|
$basepath = !empty($tag['basepath']) ? $tag['basepath'] : '/Public';
|
||||||
// 命名空间方式导入外部文件
|
// 命名空间方式导入外部文件
|
||||||
$array = explode(',', $file);
|
$array = explode(',', $file);
|
||||||
foreach ($array as $val) {
|
foreach ($array as $val) {
|
||||||
|
|||||||
@@ -166,11 +166,11 @@ class debugTest extends \PHPUnit_Framework_TestCase
|
|||||||
$var = array();
|
$var = array();
|
||||||
$var["key"] = "val";
|
$var["key"] = "val";
|
||||||
$output = \think\Debug::dump($var, false, $label = "label");
|
$output = \think\Debug::dump($var, false, $label = "label");
|
||||||
|
$array = explode("array", json_encode($output));
|
||||||
if (IS_WIN) {
|
if (IS_WIN) {
|
||||||
$this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\r\\n\"", end(explode("array", json_encode($output))));
|
$this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\r\\n\"", end($array));
|
||||||
} else {
|
} else {
|
||||||
$this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\n\"", end(explode("array", json_encode($output))));
|
$this->assertEquals("(1) {\\n 'key' =>\\n string(3) \\\"val\\\"\\n}\\n\\n\"", end($array));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class inputTest extends \PHPUnit_Framework_TestCase
|
|||||||
//session_start();
|
//session_start();
|
||||||
$_SESSION['test'] = 'session value ';
|
$_SESSION['test'] = 'session value ';
|
||||||
$this->assertEquals('session value', Input::session('test'));
|
$this->assertEquals('session value', Input::session('test'));
|
||||||
session_destroy();
|
//session_destroy();
|
||||||
|
|
||||||
$_COOKIE['cookie'] = 'cookie value ';
|
$_COOKIE['cookie'] = 'cookie value ';
|
||||||
$this->assertEquals('cookie value', Input::cookie('cookie'));
|
$this->assertEquals('cookie value', Input::cookie('cookie'));
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ EOF;
|
|||||||
{import file="base?ver=1.0" value="\$name.a" /}
|
{import file="base?ver=1.0" value="\$name.a" /}
|
||||||
EOF;
|
EOF;
|
||||||
$data = <<<EOF
|
$data = <<<EOF
|
||||||
<?php if(isset(\$name['a'])): ?><script type="text/javascript" src="__ROOT__/Public/base.js?ver=1.0"></script><?php endif; ?>
|
<?php if(isset(\$name['a'])): ?><script type="text/javascript" src="/Public/base.js?ver=1.0"></script><?php endif; ?>
|
||||||
EOF;
|
EOF;
|
||||||
$cx->parseTag($content);
|
$cx->parseTag($content);
|
||||||
$this->assertEquals($content, $data);
|
$this->assertEquals($content, $data);
|
||||||
@@ -460,7 +460,7 @@ EOF;
|
|||||||
{import file="base" type="css" /}
|
{import file="base" type="css" /}
|
||||||
EOF;
|
EOF;
|
||||||
$data = <<<EOF
|
$data = <<<EOF
|
||||||
<link rel="stylesheet" type="text/css" href="__ROOT__/Public/base.css" />
|
<link rel="stylesheet" type="text/css" href="/Public/base.css" />
|
||||||
EOF;
|
EOF;
|
||||||
$cx->parseTag($content);
|
$cx->parseTag($content);
|
||||||
$this->assertEquals($content, $data);
|
$this->assertEquals($content, $data);
|
||||||
|
|||||||
Reference in New Issue
Block a user