znt/module/tutorial/test/model/getplans.php

29 lines
1,006 B
PHP
Executable file
Raw 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=测试 tutorialModel::getPlans();
timeout=0
cid=19448
- 步骤1:正常调用返回数组长度为1 @1
- 步骤2:验证数组键名为1 @1
- 步骤3:验证计划id第1条的id属性 @1
- 步骤4:验证计划标题第1条的title属性 @Test plan
- 步骤5:验证计划状态第1条的status属性 @wait
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$tutorialTest = new tutorialModelTest();
r(count($tutorialTest->getPlansTest())) && p() && e(1); // 步骤1:正常调用返回数组长度为1
r(array_keys($tutorialTest->getPlansTest())) && p('0') && e('1'); // 步骤2:验证数组键名为1
r($tutorialTest->getPlansTest()) && p('1:id') && e('1'); // 步骤3:验证计划id
r($tutorialTest->getPlansTest()) && p('1:title') && e('Test plan'); // 步骤4:验证计划标题
r($tutorialTest->getPlansTest()) && p('1:status') && e('wait'); // 步骤5:验证计划状态