-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Randy Čupić
committed
Sep 17, 2024
1 parent
0092831
commit 026e7c4
Showing
14 changed files
with
216 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/lib/Core/Provider/Cloudinary/CloudinaryConfigurationInitializer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Netgen\RemoteMedia\Tests\Core\Provider\Cloudinary; | ||
|
||
use Cloudinary\Configuration\Configuration; | ||
|
||
final class CloudinaryConfigurationInitializer | ||
{ | ||
public const CLOUD_NAME = 'testcloud'; | ||
|
||
public const API_KEY = 'apikey'; | ||
|
||
public const API_SECRET = 'apisecret'; | ||
|
||
public const UPLOAD_PREFIX = 'https://api.cloudinary.com'; | ||
|
||
public const ENCRYPTION_KEY = '38128319a3a49e1d589a31a217e1a3f8'; | ||
|
||
public static function getConfiguration(): Configuration | ||
{ | ||
return Configuration::instance([ | ||
'cloud_name' => self::CLOUD_NAME, | ||
'api_key' => self::API_KEY, | ||
'api_secret' => self::API_SECRET, | ||
'upload_prefix' => self::UPLOAD_PREFIX, | ||
'cdn_subdomain' => false, | ||
'force_version' => false, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/lib/Core/Provider/Cloudinary/Factory/CloudinaryConfigurationTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Netgen\RemoteMedia\Tests\Core\Provider\Cloudinary\Factory; | ||
|
||
use Netgen\RemoteMedia\Core\Provider\Cloudinary\Factory\CloudinaryConfiguration as CloudinaryConfigurationFactory; | ||
use Netgen\RemoteMedia\Tests\AbstractTestCase; | ||
use Netgen\RemoteMedia\Tests\Core\Provider\Cloudinary\CloudinaryConfigurationInitializer; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
|
||
#[CoversClass(CloudinaryConfigurationFactory::class)] | ||
final class CloudinaryConfigurationTest extends AbstractTestCase | ||
{ | ||
protected CloudinaryConfigurationFactory $cloudinaryConfigurationFactory; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->cloudinaryConfigurationFactory = new CloudinaryConfigurationFactory( | ||
CloudinaryConfigurationInitializer::CLOUD_NAME, | ||
CloudinaryConfigurationInitializer::API_KEY, | ||
CloudinaryConfigurationInitializer::API_SECRET, | ||
CloudinaryConfigurationInitializer::UPLOAD_PREFIX, | ||
false, | ||
); | ||
} | ||
|
||
public function testCreate(): void | ||
{ | ||
self::assertSame( | ||
CloudinaryConfigurationInitializer::getConfiguration(), | ||
$this->cloudinaryConfigurationFactory->create(), | ||
); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
tests/lib/Core/Provider/Cloudinary/Factory/CloudinaryInstanceTest.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.