znt/module/doc/test/model/getdocblockcontent.php

29 lines
1 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 docModel::getDocBlockContent();
timeout=0
cid=16075
- 测试1存在的文档块返回解析后的JSON数组属性title @测试文档块
- 测试2不存在的文档块ID @0
- 测试3无效ID0 @0
- 测试4包含数组数据的文档块第data条的0属性 @1
- 测试5空内容的文档块 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$docTest = new docModelTest();
r($docTest->getDocBlockContentTest(1)) && p('title') && e('测试文档块'); // 测试1存在的文档块返回解析后的JSON数组
r($docTest->getDocBlockContentTest(999)) && p() && e('0'); // 测试2不存在的文档块ID
r($docTest->getDocBlockContentTest(0)) && p() && e('0'); // 测试3无效ID0
r($docTest->getDocBlockContentTest(2)) && p('data:0') && e('1'); // 测试4包含数组数据的文档块
r($docTest->getDocBlockContentTest(4)) && p() && e('0'); // 测试5空内容的文档块