Files
EasySoft-ZenTaoPMS/module/cne/test/model/appdblist.php
T
2025-09-15 15:06:12 +08:00

55 lines
1.7 KiB
PHP
Executable File
Raw 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=测试 cneModel::appDBList();
timeout=0
cid=0
- 执行cneTest模块的appDBListByInstanceTest方法,参数是$instance1 @0
- 执行cneTest模块的appDBListByInstanceTest方法,参数是$instance2 @0
- 执行cneTest模块的appDBListByInstanceTest方法,参数是$instance3 @0
- 执行cneTest模块的appDBListByInstanceTest方法,参数是$instance4 @0
- 执行cneTest模块的appDBListByInstanceTest方法,参数是$instance5 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/cne.unittest.class.php';
su('admin');
$cneTest = new cneTest();
// 测试步骤1:创建有效实例对象
$instance1 = new stdClass();
$instance1->k8name = 'test-app1';
$instance1->spaceData = new stdClass();
$instance1->spaceData->k8space = 'test-namespace1';
// 测试步骤2:空实例对象
$instance2 = null;
// 测试步骤3:k8name为空的实例
$instance3 = new stdClass();
$instance3->k8name = '';
$instance3->spaceData = new stdClass();
$instance3->spaceData->k8space = 'test-namespace3';
// 测试步骤4spaceData为空的实例
$instance4 = new stdClass();
$instance4->k8name = 'test-app4';
$instance4->spaceData = null;
// 测试步骤5spaceData->k8space为空的实例
$instance5 = new stdClass();
$instance5->k8name = 'test-app5';
$instance5->spaceData = new stdClass();
$instance5->spaceData->k8space = '';
r($cneTest->appDBListByInstanceTest($instance1)) && p() && e('0');
r($cneTest->appDBListByInstanceTest($instance2)) && p() && e('0');
r($cneTest->appDBListByInstanceTest($instance3)) && p() && e('0');
r($cneTest->appDBListByInstanceTest($instance4)) && p() && e('0');
r($cneTest->appDBListByInstanceTest($instance5)) && p() && e('0');