<?php
/*
* Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* Http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
include 'BaiduBce.phar';
require 'CdnSampleConf.php';
use BaiduBce\Services\Cdn\CdnClient;
use BaiduBce\BceClientConfigOptions;
use BaiduBce\Log\LogFactory;
class CdnClientTest extends PHPUnit_Framework_TestCase
{
public function __construct()
{
global $g_CDN_TEST_CONFIG;
parent::__construct();
$this->client = new CdnClient($g_CDN_TEST_CONFIG);
$this->logger = LogFactory::getLogger(get_class($this));
}
/**
* test create domain
*/
public static function setUpBeforeClass()
{
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$origins = array(
array("peer" => "test.origin.domain.com"),
);
$client->createDomain($domain, $origins);
}
/**
* test delete domain
*/
public static function tearDownAfterClass()
{
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$client->deleteDomain($domain);
}
/**
* test list domain
*/
public function testListDomain()
{
$resp = $this->client->listDomains();
$this->assertNotNull($resp);
}
/**
* test valid domain
*/
public function testValidDomain() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->validDomain($domain);
$this->assertNotNull($resp);
}
/**
* test list user domains
*/
public function testListUserDomains() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$status = "RUNNING";
$rule = "www";
$param = array(
'status' => $status,
'rule' => $rule
);
$resp = $client->listUserDomains($param);
$this->assertNotNull($resp);
}
/**
* test valid domain
* @expectedException Exception
* @throws \BaiduBce\Exception\BceClientException
*/
public function testValidDomainThrow() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "";
$resp = $client->validDomain($domain);
}
/**
* test start domain
*/
public function testEnableDomain()
{
$domain = "test-sdk.sys-qa.com";
$resp = $this->client->enableDomain($domain);
$this->assertNotNull($resp);
}
/**
* test stop domain
*/
public function testDisableDomain()
{
$domain = "test-sdk.sys-qa.com";
$resp = $this->client->disableDomain($domain);
$this->assertNotNull($resp);
}
/**
* test update domain origin address
*/
public function testSetDomainOrigin()
{
$domain = "test-sdk.sys-qa.com";
$origins = array(
array(
"peer" => "test.origin-new.domain.com",
'host' => 'www.origin-host.com'
),
);
$resp = $this->client->setDomainOrigin($domain, $origins);
$this->assertNotNull($resp);
}
/**
* test get domain config
*/
public function testGetDomainConfig()
{
$domain = "test-sdk.sys-qa.com";
$resp = $this->client->getDomainConfig($domain);
$this->assertNotNull($resp);
}
/**
* test get domain cacheFullUrl
*/
public function testGetDomainCacheFullUrl() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->getDomainCacheFullUrl($domain);
$this->assertNotNull($resp);
}
/**
* test get domain cacheFullUrl
* @expectedException Exception
* @throws \BaiduBce\Exception\BceClientException
*/
public function testGetDomainCacheFullUrlThrow() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "";
$resp = $client->getDomainCacheFullUrl($domain);
}
/**
* test set domain errorPage
*/
public function testSetDomainErrorPage() {
global $g_CDN_TEST_CONFIG;
$errorPage = array(
'errorPage' => array(
array(
'code' => 404,
"redirectCode" => 302,
"url" => "customer_404.html"
),
array(
'code' => 403,
"url" => "customer_403.html"
)
)
);
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->setDomainErrorPage($domain, $errorPage);
$this->assertNotNull($resp);
}
/**
* test set domain errorPage
* @expectedException Exception
* @throws \BaiduBce\Exception\BceClientException
*/
public function testSetDomainErrorPageThrow() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "";
$errorPage = array();
$resp = $client->setDomainErrorPage($domain, $errorPage);
}
/**
* test get domain errorPage
*/
public function testGetDomainErrorPage() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->getDomainErrorPage($domain);
$this->assertNotNull($resp);
}
/**
* test get domain errorPage
* @expectedException Exception
* @throws \BaiduBce\Exception\BceClientException
*/
public function testGetDomainErrorPageThrow() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "";
$resp = $client->getDomainErrorPage($domain);
}
/**
* test set domain requestAuth
*/
public function testSetDomainRequestAuth() {
global $g_CDN_TEST_CONFIG;
$requestAuth = array(
'requestAuth' => array(
"type" => "c",
"key1" => "secretekey1",
"key2" => "secretekey2",
"timeout" => 300,
"whiteList" => array("/crossdomain.xml"),
"signArg" => "sign",
"timeArg" => "t"
)
);
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "test-sdk.sys-qa.com";
$resp = $client->setDomainRequestAuth($domain, $requestAuth);
$this->assertNotNull($resp);
}
/**
* test set domain requestAuth
* @expectedException Exception
* @throws \BaiduBce\Exception\BceClientException
*/
public function testSetDomainRequestAuthThrow() {
global $g_CDN_TEST_CONFIG;
$client = new CdnClient($g_CDN_TEST_CONFIG);
$domain = "";
$requestAuth = array();
$client->setDomainRequestAuth($domain, $requestAuth);
}
/**
* test set domain cors
*/
public function testSetDomainCors() {
global $g_CDN_TEST_CONFIG;
$cors = array(
'cors' => array(
"allow" => "on",
'originList' => array(
"www.baidu.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
极简后台管理系统 - 基于ThinkPHP8和Vue3开发,包含886个文件,如JS、PHP、CSS、JPG、TPL、TTF、GITIGNORE、ICO和MD等。该系统是一个后台管理系统,提供登录退出、权限管理、日志管理、接口文档与调试等基础功能。系统采用前后端分离的架构,简单轻量,免费开源,开箱即用,为用户提供了一个高效、易用的后台管理平台。
资源推荐
资源详情
资源评论
收起资源包目录
基于ThinkPHP8和Vue3的极简后台管理系统设计源码 (886个子文件)
index.bb5f7dec.css 1.27MB
index.CRfRUC3g.css 61KB
el-col.BHuqEUVx.css 32KB
login.nfirucNx.css 30KB
el-date-picker.Cc9Q1lE-.css 24KB
index.DIktQ9xO.css 20KB
el-table-column.DfXH0ILT.css 18KB
index.DHdzL8nj.css 18KB
el-tab-pane.DtogbrcY.css 18KB
el-select.CNvzzgfv.css 16KB
index.CGpCc2NB.css 15KB
index.eab15ee3.css 14KB
el-radio.CIOqYpPl.css 13KB
index.978a0d55.css 7KB
index.BfvGcrg3.css 7KB
Skeleton.f112a820.css 7KB
el-color-picker.D7-KGbWB.css 6KB
el-checkbox.L25HMqK9.css 6KB
index.CCHkaWSq.css 6KB
el-tree.BmAHVgMg.css 5KB
el-dialog.bR83RuTG.css 4KB
el-form-item.Bbol9JFK.css 4KB
el-switch.Cu2WAeK4.css 4KB
el-descriptions-item.DaHDeD5A.css 3KB
el-link.DQuNdmJH.css 3KB
el-image-viewer.C0EQQ6mW.css 3KB
el-popper.oCjlJuOD.css 2KB
menu._XVM4K-N.css 2KB
el-loading.Uv12lkco.css 2KB
index.ec55b3ce.css 2KB
el-result.BrVnrXn_.css 1KB
el-scrollbar.MV3zttVF.css 1KB
SystemSetting.CoF-spH0.css 1KB
el-text.BsakIiL3.css 1KB
el-card.B0auzBUa.css 910B
el-avatar.BOWBgrtT.css 865B
el-statistic.BW6O5LqA.css 846B
el-row.DLmRspyZ.css 491B
index.755d13d6.css 398B
FileUploads.CQz75Wrh.css 298B
index.Cvxvcc8r.css 139B
el-radio-group._qa-vnCb.css 83B
member.B2Vaju2H.css 65B
el-checkbox-group.B3ldtHxN.css 46B
style.css 23B
.env.example 3KB
.gitignore 266B
.gitignore 14B
.gitignore 13B
.gitignore 11B
.htaccess 217B
nginx.htaccess 109B
index.html 3KB
index.html 2KB
favicon.ico 198KB
favicon.ico 17KB
favicon.ico 17KB
favicon.ico 17KB
yyladmin.jpg 88KB
yyladmin_login.jpg 39KB
3.jpg 31KB
6.jpg 31KB
1.jpg 30KB
7.jpg 30KB
8.jpg 29KB
2.jpg 29KB
4.jpg 28KB
5.jpg 27KB
ajcaptcha.BAFRzqAa.jpg 20KB
12.jpg 14KB
10.jpg 3KB
9.jpg 3KB
11.jpg 2KB
ts.worker.bundle.js 8.57MB
index.d0b2fdb6.js 3.91MB
index.DjA_re4j.js 1.28MB
json.worker.bundle.js 644KB
member.C-57B-e0.js 442KB
installCanvasRenderer.Dli4la9x.js 403KB
editor.worker.bundle.js 372KB
index.06203805.js 215KB
login.DDVU5Jsk.js 84KB
Skeleton.aa5f4cc6.js 79KB
el-date-picker.CMm1Jx1A.js 74KB
install.PrxNc9AB.js 69KB
el-table-column.CECY1sm-.js 68KB
menu.DA1NBOUz.js 68KB
index.De39iDjm.js 63KB
install.CxXCe2J_.js 43KB
index.CoXHxz2g.js 42KB
el-popper.Cw-ytP0e.js 38KB
jsonMode.0cf411ad.js 38KB
setting.xHVxUvhL.js 31KB
el-select._wYx6vZR.js 31KB
el-form-item.hhV0qe52.js 30KB
el-tree.jrltsC1b.js 25KB
group.4V5IMSXw.js 25KB
content.CVAKZqo9.js 25KB
user.BHtfjdQ8.js 25KB
api.wZ38QArX.js 24KB
共 886 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
沐知全栈开发
- 粉丝: 4771
- 资源: 3372
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功