Skip to content

Commit

Permalink
test(qcloud): 初始化 Cos 测试
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Feb 27, 2022
1 parent 73ed479 commit f534e00
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
5 changes: 3 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<phpunit backupGlobals="false"
colors="true"
stderr="true"
bootstrap="vendor/miaoxing/plugin/tests/bootstrap.php"
bootstrap="plugins/plugin/tests/bootstrap.php"
>

<testsuites>
Expand All @@ -15,7 +15,8 @@
<filter>
<whitelist>
<directory>src</directory>
<directory>resources</directory>
<directory>views</directory>
<directory>pages</directory>
<exclude>
<directory>src/Lib</directory>
<directory>src/Migration</directory>
Expand Down
25 changes: 25 additions & 0 deletions tests/src/Service/CosTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace MiaoxingTest\Qcloud\Service;

use Miaoxing\Plugin\Test\BaseTestCase;
use Miaoxing\Qcloud\Service\Cos;
use Qcloud\Cos\Client;

class CosTest extends BaseTestCase
{
public function testGetClient()
{
if (!$this->wei->getConfig('cos')) {
$this->wei->setConfig('cos', [
'region' => 'ap-shanghai',
'secretId' => 'secretId',
'secretKey' => 'secretKey',
'bucket' => 'bucket',
]);
}

$client = Cos::getClient();
$this->assertInstanceOf(Client::class, $client);
}
}
2 changes: 0 additions & 2 deletions tests/travis.ini

This file was deleted.

0 comments on commit f534e00

Please sign in to comment.