From f621cf9ceeabe3b6720a33a276b2ff6bd221c9dd Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 15 Jul 2020 16:12:37 +0400 Subject: Utility of get key Signed-off-by: Valentin Popov --- tests/Utilities/GetKeyUtility.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Utilities/GetKeyUtility.php (limited to 'tests/Utilities') diff --git a/tests/Utilities/GetKeyUtility.php b/tests/Utilities/GetKeyUtility.php new file mode 100644 index 0000000..a72601e --- /dev/null +++ b/tests/Utilities/GetKeyUtility.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package Tests\Utilities + */ +final class GetKeyUtility { + /** + * @return string + */ + public static function get(): string { + $result = Dotenv::createImmutable(dirname(__DIR__, 2))->load(); + + return $result['EPG_SERVICE_KEY'] ?? ''; + } +} -- cgit v1.2.3 From 81687eb05afd20022459054390186a7d3314822b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 15 Jul 2020 16:14:14 +0400 Subject: Utility of get environment Signed-off-by: Valentin Popov --- tests/Utilities/GetServiceEnvironment.php | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Utilities/GetServiceEnvironment.php (limited to 'tests/Utilities') diff --git a/tests/Utilities/GetServiceEnvironment.php b/tests/Utilities/GetServiceEnvironment.php new file mode 100644 index 0000000..cba08ae --- /dev/null +++ b/tests/Utilities/GetServiceEnvironment.php @@ -0,0 +1,38 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package Tests\Utilities + */ +final class GetServiceEnvironment { + /** + * @return \EPGService\Environments\ServiceEnvironment + */ + public static function get(): ServiceEnvironment { + $key = GetKeyUtility::get(); + + return ServiceEnvironment::create($key); + } +} -- cgit v1.2.3 From f01649b2e18c662a63a38315e8e403fdb2db5a4d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 17 Jul 2020 15:48:46 +0400 Subject: Added get credit entity utility Signed-off-by: Valentin Popov --- tests/Utilities/GetCreditEntityUtility.php | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/Utilities/GetCreditEntityUtility.php (limited to 'tests/Utilities') diff --git a/tests/Utilities/GetCreditEntityUtility.php b/tests/Utilities/GetCreditEntityUtility.php new file mode 100644 index 0000000..f46b176 --- /dev/null +++ b/tests/Utilities/GetCreditEntityUtility.php @@ -0,0 +1,39 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package Tests\Utilities + */ +final class GetCreditEntityUtility { + public static function get(): CreditEntity { + $faker = Faker::create(); + + return CreditEntity::create([ + 'name' => $faker->unique()->sha256, + 'type' => $faker->unique()->sha256, + ]); + } +} -- cgit v1.2.3