AmazonS3Test::setUpBeforeClass()   B
last analyzed

Complexity

Conditions 5
Paths 8

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 30

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 0
cts 13
cp 0
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 9
nc 8
nop 0
crap 30
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