znt/module/company/test/model/getbyid.php

29 lines
856 B
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
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
zenData('company')->gen(5);
/**
title=测试 companyModel::getByID();
timeout=0
cid=15731
- 步骤1正常有效ID查询公司名称 @易软天创网络科技有限公司
- 步骤2边界值ID=0的查询处理 @0
- 步骤3负数ID的异常输入处理 @0
- 步骤4超大ID值查询不存在公司 @0
- 步骤5字符串类型ID的类型转换处理 @0
*/
$companyTest = new companyModelTest();
r($companyTest->getByIDTest(1)) && p('name') && e('易软天创网络科技有限公司');
r($companyTest->getByIDTest(0)) && p() && e('0');
r($companyTest->getByIDTest(-1)) && p() && e('0');
r($companyTest->getByIDTest(999)) && p() && e('0');
r($companyTest->getByIDTest('abc')) && p() && e('0');