Skip to content

Commit 73d24fa

Browse files
committed
init
1 parent b1b6efa commit 73d24fa

File tree

8 files changed

+150
-0
lines changed

8 files changed

+150
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.idea
2+
/.DS_Store
3+
/vendor
4+
phpunit.xml
5+
composer.lock

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: php
2+
php:
3+
- 7.1
4+
- 7.0
5+
- 5.6
6+
- 5.5
7+
install:
8+
- composer self-update
9+
- composer install --no-interaction
10+
script:
11+
- php vendor/bin/phpunit

composer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "aliyunapi/php-aliyun-open-api-live",
3+
"description": "aliyunsdk",
4+
"keywords": [
5+
"aliyun",
6+
"aliyun sdk",
7+
"aliyun"
8+
],
9+
"type": "library",
10+
"license": "Apache",
11+
"support": {
12+
"issues": "https://github.com/aliyunapi/php-aliyun-open-api-live/issues",
13+
"source": "https://github.com/aliyunapi/php-aliyun-open-api-live"
14+
},
15+
"authors": [
16+
{
17+
"name": "Xu TL",
18+
"email": "xutongle@gmail.com"
19+
}
20+
],
21+
"require": {
22+
"php": ">=5.5.0",
23+
"aliyunapi/php-aliyun-open-api-core": "~1.0 | dev-master"
24+
},
25+
"require-dev": {
26+
"phpunit/phpunit": "4.*"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"aliyun\\live\\": "src"
31+
}
32+
},
33+
"autoload-dev": {
34+
"psr-4": {
35+
"aliyun\\test\\live\\": "tests"
36+
}
37+
},
38+
"scripts": {
39+
"test": "phpunit"
40+
}
41+
}

phpunit.xml.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<phpunit bootstrap="./tests/bootstrap.php"
3+
colors="true"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true"
7+
stopOnFailure="false">
8+
<testsuites>
9+
<testsuite name="Aliyun Test Suite">
10+
<directory>./tests</directory>
11+
</testsuite>
12+
</testsuites>
13+
</phpunit>

src/Client.php

Whitespace-only changes.

tests/TestCase.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
namespace aliyun\test;
21+
22+
use aliyun\core\Client;
23+
24+
use aliyun\core\profile\DefaultProfile;
25+
26+
class TestCase extends \PHPUnit_Framework_TestCase
27+
{
28+
29+
public $client = null;
30+
31+
function setUp()
32+
{
33+
$iClientProfile = DefaultProfile::getProfile("cn-hangzhou", "5slyhuy4sv30bmppvgew0rps", "NGYL1I7hXC6SgSqkcE5DJdPgJM8=");
34+
$this->client = new Client($iClientProfile);
35+
}
36+
37+
38+
function getProperty($propertyKey)
39+
{
40+
$accessKey = "";
41+
$accessSecret = "";
42+
$iClientProfile = DefaultProfile::getProfile("cn-hangzhou", "5slyhuy4sv30bmppvgew0rps", "NGYL1I7hXC6SgSqkcE5DJdPgJM8=");
43+
}
44+
45+
}

tests/bootstrap.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
use aliyun\core\regions\Endpoint;
3+
use aliyun\core\regions\EndpointConfig;
4+
use aliyun\core\regions\EndpointProvider;
5+
6+
// ensure we get report on all possible php errors
7+
error_reporting(-1);
8+
// require composer autoloader if available
9+
$composerAutoload = __DIR__ . '/../vendor/autoload.php';
10+
if (is_file($composerAutoload)) {
11+
require_once($composerAutoload);
12+
}
13+
14+
/**
15+
* 配置网关
16+
*/
17+
$endpoint = new Endpoint('cn-hangzhou', EndpointConfig::getRegionIds(), EndpointConfig::getProductDomains());
18+
EndpointProvider::setEndpoints([ $endpoint ]);
19+
20+
require_once(__DIR__ . '/TestCase.php');

0 commit comments

Comments
 (0)