#!/usr/bin/env php loadYaml('initlibforteamspace', false, 2)->gen(10); su('admin'); global $tester; $docTest = new docZenTest(); $tester->dao->delete()->from(TABLE_DOCLIB)->where('type')->eq('custom')->exec(); $docTest->initLibForTeamSpaceTest(); r($tester->dao->select('count(*) as count')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch('count')) && p() && e('1'); // 步骤1:验证创建了团队空间库 r($tester->dao->select('*')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch()) && p('type') && e('custom'); // 步骤2:验证类型 r($tester->dao->select('*')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch()) && p('acl') && e('open'); // 步骤3:验证acl $docTest->initLibForTeamSpaceTest(); r($tester->dao->select('count(*) as count')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch('count')) && p() && e('1'); // 步骤4:验证只有一个团队空间库 su('user1'); $tester->dao->delete()->from(TABLE_DOCLIB)->where('type')->eq('custom')->exec(); $docTest->initLibForTeamSpaceTest(); r($tester->dao->select('count(*) as count')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch('count')) && p() && e('1'); // 步骤5:验证user1创建了团队空间库 r($tester->dao->select('*')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch()) && p('addedBy') && e('user1'); // 步骤6:验证addedBy r($tester->dao->select('*')->from(TABLE_DOCLIB)->where('type')->eq('custom')->fetch()) && p('vision') && e('rnd'); // 步骤7:验证vision