diff --git a/.gitignore b/.gitignore index e244eda..99177e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ -/.idea/ \ No newline at end of file +/.idea/ +/phpunit.xml \ No newline at end of file diff --git a/Service/JwtKeeper.php b/Service/JwtKeeper.php index ce32a24..39b4de1 100644 --- a/Service/JwtKeeper.php +++ b/Service/JwtKeeper.php @@ -10,17 +10,11 @@ class JwtKeeper private $jwtProvider; /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\InvalidJwtContentException - * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\JwtException * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\StorageFileNameException - * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\StoreTokenException - * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\UnexpectedTokenTypeException */ public function __construct(string $serviceUrl, string $username, string $password) { $this->jwtProvider = new JwtProvider($serviceUrl, $username, $password); - $this->provideJwt(); } /** diff --git a/Tests/JwtConnectorTest.php b/Tests/JwtConnectorTest.php deleted file mode 100755 index bc802fa..0000000 --- a/Tests/JwtConnectorTest.php +++ /dev/null @@ -1,24 +0,0 @@ -getToken(); - } -} - - -$t = new JwtKeeperTest(); -$t->testGetToken(); \ No newline at end of file diff --git a/composer.json b/composer.json index 450936e..9ae60c2 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,17 @@ "symfony/http-kernel": "^4.2", "guzzlehttp/guzzle": "^6.3" }, + "require-dev": { + "symfony/phpunit-bridge": "^4.2" + }, "autoload" : { "psr-4" : { "MaciejKosiarski\\JwtKeeperBundle\\" : "" } + }, + "autoload-dev": { + "psr-4": { + "MaciejKosiarski\\JwtKeeperBundle\\Tests\\" : "tests/" + } } } diff --git a/composer.lock b/composer.lock index 7a9c74b..9b13c7b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4ab2ca19c8674e75f5b02dca757dbd40", + "content-hash": "f1701798625e2b45c6cb5867fb861700", "packages": [ { "name": "guzzlehttp/guzzle", @@ -775,7 +775,73 @@ "time": "2018-09-21T13:07:52+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "symfony/phpunit-bridge", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "2cc651a38fcb831a405c14fcb76fcb00320e7ee8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/2cc651a38fcb831a405c14fcb76fcb00320e7ee8", + "reference": "2cc651a38fcb831a405c14fcb76fcb00320e7ee8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "suggest": { + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + }, + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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 PHPUnit Bridge", + "homepage": "https://symfony.com", + "time": "2019-02-18T06:49:49+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..fbfa664 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,28 @@ + + + + + ./tests + + + + + ./src + + + \ No newline at end of file diff --git a/tests/JwtKeeperTest.php b/tests/JwtKeeperTest.php new file mode 100755 index 0000000..f02777d --- /dev/null +++ b/tests/JwtKeeperTest.php @@ -0,0 +1,11 @@ +