AmazonS3Test   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 20
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B setUpBeforeClass() 0 17 5
1
<?php
2
3
/*
4
 * This file is part of the limit0/assets package.
5
 *
6
 * (c) Limit Zero, LLC <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Limit0\Assets\Tests\StorageEngine;
13
14
use Aws\S3\S3Client;
15
use Limit0\Assets\StorageEngine\AmazonS3StorageEngine;
16
17
/**
18
 * Configures the AmazonS3 StorageEngine
19
 *
20
 * @author  Josh Worden <[email protected]>
21
 */
22
class AmazonS3Test extends AbstractStorageEngineTest
23
{
24
    public static function setUpBeforeClass()
25
    {
26
        if (!class_exists('Aws\S3\S3Client')) {
27
            self::markTestSkipped('AWS SDK not installed.');
28
        }
29
30
        if (false === getenv('AWS_ACCESS_KEY_ID') || false === getenv('AWS_SECRET_ACCESS_KEY')) {
31
            self::markTestSkipped('AWS Credentials not present!');
32
        }
33
34
        if (false === $bucket = getenv('AWS_S3_BUCKET_NAME')) {
35
            self::markTestSkipped('AWS Bucket Name is not present!');
36
        }
37
38
        self::$engine = new AmazonS3StorageEngine();
39
        self::$engine->setBucket($bucket)->setAcl('public-read');
40
    }
41
}
42