* Add unit test for isclickable.

This commit is contained in:
wangyidong
2023-12-20 19:41:11 +08:00
parent 48b20df0de
commit bc564dbf1e
2 changed files with 36 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php
/**
title=测试 mailModel->isClickable();
cid=0
- 不传入method参数 @0
- 传入method=delete参数 @1
- 传入method=resend参数 @0
- 传入method=resend参数, item的status字段为fail @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
su('admin');
zdTable('notify')->gen(2);
global $tester;
$mailModel = $tester->loadModel('mail');
$mailModel->app->user->admin = true;
$notify = $mailModel->getQueueById(1);
r($mailModel->isClickable($notify, '')) && p() && e('0'); //不传入method参数
r($mailModel->isClickable($notify, 'delete')) && p() && e('1'); //传入method=delete参数
r($mailModel->isClickable($notify, 'resend')) && p() && e('0'); //传入method=resend参数
$notify->status = 'fail';
r($mailModel->isClickable($notify, 'resend')) && p() && e('1'); //传入method=resend参数, item的status字段为fail
+5 -3
View File
@@ -4,10 +4,12 @@
/**
title=测试 mailModel->sendmail();
cid=1
pid=1
cid=0
测试为dev4用户发送邮件通知 >> 0
- 不传入任何参数 @0
- 只传入actionID @0
- 只传入objectID @0
- 测试为需求2发送邮件通知 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';