aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2020-07-22 11:36:45 +0300
committerGitHub <noreply@github.com>2020-07-22 11:36:45 +0300
commit56395937629476cbb41bfe251f67e6725767c726 (patch)
tree51acd99b4e3ff1e3429fb06ef6daedaf43af5106
parent24da358b533bcf580e638c66e1ba8f2980d5bc12 (diff)
parent862e46de9ec860b9925dde1ed4b7b385ff49508f (diff)
downloadphp-epg-service-master.tar.xz
php-epg-service-master.zip
Merge pull request #2 from valentineus/developHEADmaster
Develop
-rw-r--r--composer.json2
-rw-r--r--composer.lock435
-rw-r--r--src/Parsers/IntegerParser.php36
-rw-r--r--src/Repositories/CategoryRepository.php4
-rw-r--r--src/Repositories/GenreRepository.php2
-rw-r--r--tests/Entities/ChannelEntityTest.php2
-rw-r--r--tests/Parsers/IntegerParserTest.php36
-rw-r--r--tests/Repositories/CategoryRepositoryTest.php9
-rw-r--r--tests/Repositories/ChannelRepositoryTest.php5
-rw-r--r--tests/Repositories/GenreRepositoryTest.php9
10 files changed, 385 insertions, 155 deletions
diff --git a/composer.json b/composer.json
index f292995..7eacea2 100644
--- a/composer.json
+++ b/composer.json
@@ -17,7 +17,7 @@
}
},
"require": {
- "guzzlehttp/guzzle": "^7.0",
+ "guzzlehttp/guzzle": "^6.0",
"ext-SimpleXML": "^7.4"
},
"require-dev": {
diff --git a/composer.lock b/composer.lock
index 0fd47d7..20d6f77 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,48 +4,41 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "740aecc5e2319aaf77d3b09e7feae5d4",
+ "content-hash": "0b58725f7f5dfe79433a52db5bcecc19",
"packages": [
{
"name": "guzzlehttp/guzzle",
- "version": "7.0.1",
+ "version": "6.5.5",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "2d9d3c186a6637a43193e66b097c50e4451eaab2"
+ "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/2d9d3c186a6637a43193e66b097c50e4451eaab2",
- "reference": "2d9d3c186a6637a43193e66b097c50e4451eaab2",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
+ "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1",
- "php": "^7.2.5",
- "psr/http-client": "^1.0"
- },
- "provide": {
- "psr/http-client-implementation": "1.0"
+ "php": ">=5.5",
+ "symfony/polyfill-intl-idn": "^1.17.0"
},
"require-dev": {
- "ergebnis/composer-normalize": "^2.0",
"ext-curl": "*",
- "php-http/client-integration-tests": "dev-phpunit8",
- "phpunit/phpunit": "^8.5.5",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.1"
},
"suggest": {
- "ext-curl": "Required for CURL handler support",
- "ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "7.0-dev"
+ "dev-master": "6.5-dev"
}
},
"autoload": {
@@ -65,11 +58,6 @@
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
}
],
"description": "Guzzle is a PHP HTTP client library",
@@ -80,12 +68,10 @@
"framework",
"http",
"http client",
- "psr-18",
- "psr-7",
"rest",
"web service"
],
- "time": "2020-06-27T10:33:25+00:00"
+ "time": "2020-06-16T21:01:06+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -210,53 +196,49 @@
"time": "2019-07-01T23:21:34+00:00"
},
{
- "name": "psr/http-client",
- "version": "1.0.1",
+ "name": "paragonie/random_compat",
+ "version": "v9.99.99",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/http-client.git",
- "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
+ "url": "https://github.com/paragonie/random_compat.git",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
- "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
"shasum": ""
},
"require": {
- "php": "^7.0 || ^8.0",
- "psr/http-message": "^1.0"
+ "php": "^7"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "require-dev": {
+ "phpunit/phpunit": "4.*|5.*",
+ "vimeo/psalm": "^1"
},
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Client\\": "src/"
- }
+ "suggest": {
+ "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
+ "type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "name": "Paragon Initiative Enterprises",
+ "email": "security@paragonie.com",
+ "homepage": "https://paragonie.com"
}
],
- "description": "Common interface for HTTP clients",
- "homepage": "https://github.com/php-fig/http-client",
+ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
- "http",
- "http-client",
- "psr",
- "psr-18"
+ "csprng",
+ "polyfill",
+ "pseudorandom",
+ "random"
],
- "time": "2020-06-29T06:28:15+00:00"
+ "time": "2018-07-02T15:55:56+00:00"
},
{
"name": "psr/http-message",
@@ -347,6 +329,322 @@
],
"description": "A polyfill for getallheaders.",
"time": "2019-03-08T08:55:37+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-idn",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-idn.git",
+ "reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/bc6549d068d0160e0f10f7a5a23c7d1406b95ebe",
+ "reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/polyfill-intl-normalizer": "^1.10",
+ "symfony/polyfill-php70": "^1.10",
+ "symfony/polyfill-php72": "^1.10"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Idn\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Laurent Bassin",
+ "email": "laurent@bassin.info"
+ },
+ {
+ "name": "Trevor Rowbotham",
+ "email": "trevor.rowbotham@pm.me"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "idn",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-normalizer",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
+ "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "intl",
+ "normalizer",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php70",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php70.git",
+ "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
+ "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
+ "shasum": ""
+ },
+ "require": {
+ "paragonie/random_compat": "~1.0|~2.0|~9.99",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php70\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php72",
+ "version": "v1.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php72.git",
+ "reference": "639447d008615574653fb3bc60d1986d7172eaae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
+ "reference": "639447d008615574653fb3bc60d1986d7172eaae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php72\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-14T12:35:20+00:00"
}
],
"packages-dev": [
@@ -739,28 +1037,27 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.1.0",
+ "version": "5.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
+ "reference": "3170448f5769fe19f456173d833734e0ff1b84df"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
- "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df",
+ "reference": "3170448f5769fe19f456173d833734e0ff1b84df",
"shasum": ""
},
"require": {
- "ext-filter": "^7.1",
- "php": "^7.2",
- "phpdocumentor/reflection-common": "^2.0",
- "phpdocumentor/type-resolver": "^1.0",
- "webmozart/assert": "^1"
+ "ext-filter": "*",
+ "php": "^7.2 || ^8.0",
+ "phpdocumentor/reflection-common": "^2.2",
+ "phpdocumentor/type-resolver": "^1.3",
+ "webmozart/assert": "^1.9.1"
},
"require-dev": {
- "doctrine/instantiator": "^1",
- "mockery/mockery": "^1"
+ "mockery/mockery": "~1.3.2"
},
"type": "library",
"extra": {
@@ -788,7 +1085,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2020-02-22T12:28:44+00:00"
+ "time": "2020-07-20T20:05:34+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -837,24 +1134,24 @@
},
{
"name": "phpoption/phpoption",
- "version": "1.7.4",
+ "version": "1.7.5",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
- "reference": "b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3"
+ "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3",
- "reference": "b2ada2ad5d8a32b89088b8adc31ecd2e3a13baf3",
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525",
+ "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0 || ^8.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.3",
- "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
@@ -898,7 +1195,7 @@
"type": "tidelift"
}
],
- "time": "2020-06-07T10:40:07+00:00"
+ "time": "2020-07-20T17:29:33+00:00"
},
{
"name": "phpspec/prophecy",
diff --git a/src/Parsers/IntegerParser.php b/src/Parsers/IntegerParser.php
deleted file mode 100644
index ba89315..0000000
--- a/src/Parsers/IntegerParser.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Copyright 2020 “EPGService”
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an “AS IS” BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-declare(strict_types = 1);
-
-namespace EPGService\Parsers;
-
-/**
- * @copyright Copyright © 2020 “Valentin Popov” <info@valentineus.link>
- * @license http://www.apache.org/licenses/LICENSE-2.0
- * @package EPGService\Parsers
- */
-final class IntegerParser implements BaseParser {
- /**
- * @param mixed $value
- *
- * @return int
- */
- public static function get($value): int {
- return filter_var($value, FILTER_VALIDATE_INT);
- }
-}
diff --git a/src/Repositories/CategoryRepository.php b/src/Repositories/CategoryRepository.php
index 6139168..546ad2c 100644
--- a/src/Repositories/CategoryRepository.php
+++ b/src/Repositories/CategoryRepository.php
@@ -21,7 +21,6 @@ namespace EPGService\Repositories;
use EPGService\Entities\CategoryEntity;
use EPGService\Environments\ServiceEnvironment;
-use EPGService\Parsers\IntegerParser;
use EPGService\Parsers\StringParser;
use GuzzleHttp\Client;
use RuntimeException;
@@ -35,6 +34,7 @@ use function simplexml_load_string;
* @package EPGService\Repositories
*/
final class CategoryRepository implements BaseRepository {
+
/**
* @var string
*/
@@ -92,7 +92,7 @@ final class CategoryRepository implements BaseRepository {
}
$result[] = CategoryEntity::create([
- 'id' => IntegerParser::get($element['id']),
+ 'id' => StringParser::get($element['id']),
'lang' => StringParser::get($element->name['lang']),
'name' => StringParser::get($element->name),
'version' => StringParser::get($element['version']),
diff --git a/src/Repositories/GenreRepository.php b/src/Repositories/GenreRepository.php
index 67c9a4e..8b1284b 100644
--- a/src/Repositories/GenreRepository.php
+++ b/src/Repositories/GenreRepository.php
@@ -91,7 +91,7 @@ final class GenreRepository implements BaseRepository {
}
$result[] = GenreEntity::create([
- 'id' => IntegerParser::get($element['id']),
+ 'id' => StringParser::get($element['id']),
'lang' => StringParser::get($element->name['lang']),
'name' => StringParser::get($element->name),
'version' => StringParser::get($element['version']),
diff --git a/tests/Entities/ChannelEntityTest.php b/tests/Entities/ChannelEntityTest.php
index e3c2733..ace9388 100644
--- a/tests/Entities/ChannelEntityTest.php
+++ b/tests/Entities/ChannelEntityTest.php
@@ -41,7 +41,7 @@ final class ChannelEntityTest extends TestCase {
$id = $faker->unique()->sha256;
$lang = $faker->unique()->sha256;
$name = $faker->unique()->sha256;
- $update_at = $faker->unique()->sha256;
+ $update_at = $faker->unique()->dateTime;
$week = $faker->unique()->sha256;
$entity = ChannelEntity::create(compact(
diff --git a/tests/Parsers/IntegerParserTest.php b/tests/Parsers/IntegerParserTest.php
deleted file mode 100644
index 56c13ce..0000000
--- a/tests/Parsers/IntegerParserTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Copyright 2020 “EPGService”
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an “AS IS” BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-declare(strict_types = 1);
-
-namespace Tests\Parsers;
-
-use EPGService\Parsers\IntegerParser;
-use Faker\Factory as Faker;
-use PHPUnit\Framework\TestCase;
-
-/**
- * @copyright Copyright © 2020 “Valentin Popov” <info@valentineus.link>
- * @license http://www.apache.org/licenses/LICENSE-2.0
- * @package Tests\Parsers
- */
-final class IntegerParserTest extends TestCase {
- public function testValid(): void {
- $number = Faker::create()->numberBetween(100, 200);
- self::assertEquals($number, IntegerParser::get((string) $number));
- }
-}
diff --git a/tests/Repositories/CategoryRepositoryTest.php b/tests/Repositories/CategoryRepositoryTest.php
index 25dbdd8..d43269f 100644
--- a/tests/Repositories/CategoryRepositoryTest.php
+++ b/tests/Repositories/CategoryRepositoryTest.php
@@ -29,6 +29,7 @@ use Tests\Utilities\GetServiceEnvironment;
* @package Tests\Repositories
*/
final class CategoryRepositoryTest extends TestCase {
+
/**
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \RuntimeException
@@ -40,10 +41,10 @@ final class CategoryRepositoryTest extends TestCase {
foreach (CategoryRepository::create($env)->get() as $category) {
/** @var \EPGService\Entities\CategoryEntity $category */
- self::assertIsInt($category->id);
- self::assertIsString($category->lang);
- self::assertIsString($category->name);
- self::assertIsString($category->version);
+ self::assertNotEmpty($category->id);
+ self::assertNotEmpty($category->lang);
+ self::assertNotEmpty($category->name);
+ self::assertNotEmpty($category->version);
}
}
}
diff --git a/tests/Repositories/ChannelRepositoryTest.php b/tests/Repositories/ChannelRepositoryTest.php
index b9d9116..ac599a4 100644
--- a/tests/Repositories/ChannelRepositoryTest.php
+++ b/tests/Repositories/ChannelRepositoryTest.php
@@ -30,6 +30,7 @@ use Tests\Utilities\GetServiceEnvironment;
* @package Tests\Repositories
*/
final class ChannelRepositoryTest extends TestCase {
+
/**
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \RuntimeException
@@ -41,13 +42,15 @@ final class ChannelRepositoryTest extends TestCase {
foreach (ChannelRepository::create($env)->get() as $channel) {
/** @var \EPGService\Entities\ChannelEntity $channel */
+ self::assertIsString($channel->id);
+ self::assertNotEmpty($channel->id);
+
self::assertIsString($channel->base_id);
self::assertIsString($channel->base_name);
self::assertIsString($channel->epg_id);
self::assertIsString($channel->geo_data);
self::assertIsString($channel->href);
self::assertIsString($channel->icon);
- self::assertIsString($channel->id);
self::assertIsString($channel->lang);
self::assertIsString($channel->name);
self::assertIsString($channel->week);
diff --git a/tests/Repositories/GenreRepositoryTest.php b/tests/Repositories/GenreRepositoryTest.php
index 8afe351..2574059 100644
--- a/tests/Repositories/GenreRepositoryTest.php
+++ b/tests/Repositories/GenreRepositoryTest.php
@@ -29,6 +29,7 @@ use Tests\Utilities\GetServiceEnvironment;
* @package Tests\Repositories
*/
final class GenreRepositoryTest extends TestCase {
+
/**
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws \RuntimeException
@@ -40,10 +41,10 @@ final class GenreRepositoryTest extends TestCase {
foreach (GenreRepository::create($env)->get() as $genre) {
/** @var \EPGService\Entities\GenreEntity $genre */
- self::assertIsInt($genre->id);
- self::assertIsString($genre->lang);
- self::assertIsString($genre->name);
- self::assertIsString($genre->version);
+ self::assertNotEmpty($genre->id);
+ self::assertNotEmpty($genre->lang);
+ self::assertNotEmpty($genre->name);
+ self::assertNotEmpty($genre->version);
}
}
}