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

41 lines
1.3 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::isClickable();
timeout=0
cid=16142
- 步骤1当前用户文档movedoc操作 @1
- 步骤2其他用户文档movedoc操作 @0
- 步骤3当前用户文档edit操作 @1
- 步骤4其他用户文档edit操作 @1
- 步骤5空文档对象movedoc操作 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('doc')->gen(10);
su('admin');
$docTest = new docModelTest();
// 创建测试用的文档对象
$currentUserDoc = new stdClass();
$currentUserDoc->addedBy = 'admin';
$otherUserDoc = new stdClass();
$otherUserDoc->addedBy = 'user';
$emptyDoc = new stdClass();
$emptyDoc->addedBy = '';
r($docTest->isClickableTest($currentUserDoc, 'movedoc')) && p() && e('1'); // 步骤1当前用户文档movedoc操作
r($docTest->isClickableTest($otherUserDoc, 'movedoc')) && p() && e('0'); // 步骤2其他用户文档movedoc操作
r($docTest->isClickableTest($currentUserDoc, 'edit')) && p() && e('1'); // 步骤3当前用户文档edit操作
r($docTest->isClickableTest($otherUserDoc, 'edit')) && p() && e('1'); // 步骤4其他用户文档edit操作
r($docTest->isClickableTest($emptyDoc, 'movedoc')) && p() && e('0'); // 步骤5空文档对象movedoc操作