znt/module/holiday/test/model/getholidaybyapi.php

32 lines
1,005 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
/**
title=测试 holidayModel::getHolidayByAPI();
timeout=0
cid=16742
- 执行holiday模块的getHolidayByAPITest方法参数是'this year' @11
- 执行holiday模块的getHolidayByAPITest方法参数是'last year' @12
- 执行holiday模块的getHolidayByAPITest方法参数是'next year' @14
- 执行holiday模块的getHolidayByAPITest方法参数是'' @2
- 执行holiday模块的getHolidayByAPITest方法参数是'invalid' @2
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('holiday')->gen(50);
zenData('user')->gen(1);
su('admin');
$holiday = new holidayModelTest();
r($holiday->getHolidayByAPITest('this year')) && p() && e('11');
r($holiday->getHolidayByAPITest('last year')) && p() && e('12');
r($holiday->getHolidayByAPITest('next year')) && p() && e('14');
r($holiday->getHolidayByAPITest('')) && p() && e('2');
r($holiday->getHolidayByAPITest('invalid')) && p() && e('2');