Skip to content

Commit

Permalink
Removing NullCredentials. Just use Credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed May 8, 2015
1 parent f10bb03 commit 12d1058
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 77 deletions.
2 changes: 1 addition & 1 deletion src/ClientResolver.php
Expand Up @@ -342,7 +342,7 @@ public static function _apply_credentials($value, array &$args)
isset($value['expires']) ? $value['expires'] : null
);
} elseif ($value === false) {
$args['credentials'] = new NullCredentials();
$args['credentials'] = new Credentials('', '');
$args['config']['signature_version'] = 'anonymous';
} else {
throw new IAE('Credentials must be an instance of '
Expand Down
46 changes: 0 additions & 46 deletions src/Credentials/NullCredentials.php

This file was deleted.

3 changes: 1 addition & 2 deletions tests/Api/Serializer/ComplianceTest.php
Expand Up @@ -3,7 +3,6 @@

use Aws\Api\Service;
use Aws\AwsClient;
use Aws\Credentials\NullCredentials;
use Aws\Test\UsesServiceTrait;

/**
Expand Down Expand Up @@ -72,7 +71,7 @@ public function testPassesComplianceTest(
'api_provider' => function () use ($service) {
return $service->toArray();
},
'credentials' => new NullCredentials(),
'credentials' => false,
'signature' => $this->getMock('Aws\Signature\SignatureInterface'),
'region' => 'us-west-2',
'endpoint' => $ep,
Expand Down
2 changes: 1 addition & 1 deletion tests/ClientResolverTest.php
Expand Up @@ -196,7 +196,7 @@ public function testCanCreateNullCredentials()
'version' => 'latest'
], new HandlerList());
$this->assertInstanceOf(
'Aws\Credentials\NullCredentials',
'Aws\Credentials\Credentials',
$conf['credentials']
);
$this->assertEquals('anonymous', $conf['config']['signature_version']);
Expand Down
24 changes: 0 additions & 24 deletions tests/Credentials/NullCredentialsTest.php

This file was deleted.

5 changes: 2 additions & 3 deletions tests/S3/S3ClientTest.php
@@ -1,7 +1,6 @@
<?php
namespace Aws\Test\S3;

use Aws\Credentials\NullCredentials;
use Aws\MockHandler;
use Aws\Result;
use Aws\S3\S3Client;
Expand Down Expand Up @@ -186,7 +185,7 @@ public function testReturnsObjectUrl()
{
$s3 = $this->getTestClient('S3', [
'region' => 'us-east-1',
'credentials' => new NullCredentials()
'credentials' => false
]);
$this->assertEquals('https://foo.s3.amazonaws.com/bar', $s3->getObjectUrl('foo', 'bar'));
}
Expand All @@ -196,7 +195,7 @@ public function testReturnsObjectUrlViaPath()
/** @var S3Client $s3 */
$s3 = $this->getTestClient('S3', [
'region' => 'us-east-1',
'credentials' => new NullCredentials()
'credentials' => false
]);
$this->assertEquals(
'https://s3.amazonaws.com/foo.baz/bar',
Expand Down

0 comments on commit 12d1058

Please sign in to comment.