diff --git a/app/Jobs/SaveProfileImage.php b/app/Jobs/SaveProfileImage.php index cf2197e3..ebdf0ca9 100644 --- a/app/Jobs/SaveProfileImage.php +++ b/app/Jobs/SaveProfileImage.php @@ -41,11 +41,13 @@ class SaveProfileImage implements ShouldQueue { try { $author = $authorship->findAuthor($this->microformats); - } catch (AuthorshipParserException $e) { - return; + } catch (AuthorshipParserException) { + return null; } + $photo = Arr::get($author, 'properties.photo.0'); $home = Arr::get($author, 'properties.url.0'); + //dont save pbs.twimg.com links if ( $photo @@ -53,16 +55,18 @@ class SaveProfileImage implements ShouldQueue && parse_url($photo, PHP_URL_HOST) != 'twitter.com' ) { $client = resolve(Client::class); + try { $response = $client->get($photo); $image = $response->getBody(); - } catch (RequestException $e) { + } catch (RequestException) { // we are opening and reading the default image so that $default = public_path() . '/assets/profile-images/default-image'; $handle = fopen($default, 'rb'); $image = fread($handle, filesize($default)); fclose($handle); } + $path = public_path() . '/assets/profile-images/' . parse_url($home, PHP_URL_HOST) . '/image'; $parts = explode('/', $path); $name = array_pop($parts); diff --git a/composer.lock b/composer.lock index 91411408..090e7b79 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "asm89/stack-cors", - "version": "v2.0.2", + "version": "v2.0.3", "source": { "type": "git", "url": "https://github.com/asm89/stack-cors.git", - "reference": "8d8f88b3b3830916be94292c1fbce84433efb1aa" + "reference": "9cb795bf30988e8c96dd3c40623c48a877bc6714" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/asm89/stack-cors/zipball/8d8f88b3b3830916be94292c1fbce84433efb1aa", - "reference": "8d8f88b3b3830916be94292c1fbce84433efb1aa", + "url": "https://api.github.com/repos/asm89/stack-cors/zipball/9cb795bf30988e8c96dd3c40623c48a877bc6714", + "reference": "9cb795bf30988e8c96dd3c40623c48a877bc6714", "shasum": "" }, "require": { @@ -58,22 +58,22 @@ ], "support": { "issues": "https://github.com/asm89/stack-cors/issues", - "source": "https://github.com/asm89/stack-cors/tree/v2.0.2" + "source": "https://github.com/asm89/stack-cors/tree/v2.0.3" }, - "time": "2020-10-29T16:03:21+00:00" + "time": "2021-03-11T06:42:03+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.173.8", + "version": "3.174.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "e6d08cdc8206af55dd7bbb967a0350b41263018c" + "reference": "80cc136f47fa808032f411fff70e26f461852510" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e6d08cdc8206af55dd7bbb967a0350b41263018c", - "reference": "e6d08cdc8206af55dd7bbb967a0350b41263018c", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/80cc136f47fa808032f411fff70e26f461852510", + "reference": "80cc136f47fa808032f411fff70e26f461852510", "shasum": "" }, "require": { @@ -81,9 +81,9 @@ "ext-pcre": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4.1", - "mtdowling/jmespath.php": "^2.5", + "guzzlehttp/promises": "^1.4.0", + "guzzlehttp/psr7": "^1.7.0", + "mtdowling/jmespath.php": "^2.6", "php": ">=5.5" }, "require-dev": { @@ -148,9 +148,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.173.8" + "source": "https://github.com/aws/aws-sdk-php/tree/3.174.2" }, - "time": "2021-02-12T19:15:02+00:00" + "time": "2021-03-17T18:13:11+00:00" }, { "name": "brick/math", @@ -432,16 +432,16 @@ }, { "name": "cviebrock/eloquent-sluggable", - "version": "8.0.4", + "version": "8.0.5", "source": { "type": "git", "url": "https://github.com/cviebrock/eloquent-sluggable.git", - "reference": "e1f27c7b48dc7cec352d12351a147e4032c43f60" + "reference": "69cd660715fc05a7e5a1cd51c88dc56128b0ca7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/e1f27c7b48dc7cec352d12351a147e4032c43f60", - "reference": "e1f27c7b48dc7cec352d12351a147e4032c43f60", + "url": "https://api.github.com/repos/cviebrock/eloquent-sluggable/zipball/69cd660715fc05a7e5a1cd51c88dc56128b0ca7e", + "reference": "69cd660715fc05a7e5a1cd51c88dc56128b0ca7e", "shasum": "" }, "require": { @@ -493,9 +493,9 @@ ], "support": { "issues": "https://github.com/cviebrock/eloquent-sluggable/issues", - "source": "https://github.com/cviebrock/eloquent-sluggable/tree/8.0.4" + "source": "https://github.com/cviebrock/eloquent-sluggable/tree/8.0.5" }, - "time": "2021-01-20T16:25:06+00:00" + "time": "2021-02-28T20:03:09+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -1143,16 +1143,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -1192,9 +1192,9 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.0" + "source": "https://github.com/guzzle/promises/tree/1.4.1" }, - "time": "2020-09-30T07:37:28+00:00" + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", @@ -1663,16 +1663,16 @@ }, { "name": "laravel/framework", - "version": "v8.27.0", + "version": "v8.33.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "a6680d98f9dadaa363aa7d5218517a08706cee64" + "reference": "354c57b8cb457549114074c500944455a288d6cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/a6680d98f9dadaa363aa7d5218517a08706cee64", - "reference": "a6680d98f9dadaa363aa7d5218517a08706cee64", + "url": "https://api.github.com/repos/laravel/framework/zipball/354c57b8cb457549114074c500944455a288d6cc", + "reference": "354c57b8cb457549114074c500944455a288d6cc", "shasum": "" }, "require": { @@ -1780,7 +1780,7 @@ "phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0).", "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).", "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", @@ -1827,20 +1827,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-02-09T15:14:54+00:00" + "time": "2021-03-16T19:42:32+00:00" }, { "name": "laravel/horizon", - "version": "v5.6.6", + "version": "v5.7.2", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "26682428b9c580abc690086f816643325427f0fb" + "reference": "c5863ba7ecd6ca53f1dc9eaf40ba59be38bf385a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/26682428b9c580abc690086f816643325427f0fb", - "reference": "26682428b9c580abc690086f816643325427f0fb", + "url": "https://api.github.com/repos/laravel/horizon/zipball/c5863ba7ecd6ca53f1dc9eaf40ba59be38bf385a", + "reference": "c5863ba7ecd6ca53f1dc9eaf40ba59be38bf385a", "shasum": "" }, "require": { @@ -1902,9 +1902,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.6.6" + "source": "https://github.com/laravel/horizon/tree/v5.7.2" }, - "time": "2021-02-09T16:23:38+00:00" + "time": "2021-03-16T16:18:27+00:00" }, { "name": "laravel/scout", @@ -1977,21 +1977,21 @@ }, { "name": "laravel/telescope", - "version": "v4.4.2", + "version": "v4.4.6", "source": { "type": "git", "url": "https://github.com/laravel/telescope.git", - "reference": "bb2b733a8ac5c8e5da8a935e15db5624ed998de9" + "reference": "903c709b46b5f877c8434c657f964c7bdea7a6a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/telescope/zipball/bb2b733a8ac5c8e5da8a935e15db5624ed998de9", - "reference": "bb2b733a8ac5c8e5da8a935e15db5624ed998de9", + "url": "https://api.github.com/repos/laravel/telescope/zipball/903c709b46b5f877c8434c657f964c7bdea7a6a4", + "reference": "903c709b46b5f877c8434c657f964c7bdea7a6a4", "shasum": "" }, "require": { "ext-json": "*", - "laravel/framework": "^8.2", + "laravel/framework": "^8.29", "php": "^7.3|^8.0", "symfony/var-dumper": "^5.0" }, @@ -2035,22 +2035,22 @@ ], "support": { "issues": "https://github.com/laravel/telescope/issues", - "source": "https://github.com/laravel/telescope/tree/v4.4.2" + "source": "https://github.com/laravel/telescope/tree/v4.4.6" }, - "time": "2021-02-09T16:47:39+00:00" + "time": "2021-03-11T13:32:54+00:00" }, { "name": "laravel/tinker", - "version": "v2.6.0", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "daae1c43f1300fe88c05d83db6f3d8f76677ad88" + "reference": "04ad32c1a3328081097a181875733fa51f402083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/daae1c43f1300fe88c05d83db6f3d8f76677ad88", - "reference": "daae1c43f1300fe88c05d83db6f3d8f76677ad88", + "url": "https://api.github.com/repos/laravel/tinker/zipball/04ad32c1a3328081097a181875733fa51f402083", + "reference": "04ad32c1a3328081097a181875733fa51f402083", "shasum": "" }, "require": { @@ -2103,9 +2103,9 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.6.0" + "source": "https://github.com/laravel/tinker/tree/v2.6.1" }, - "time": "2021-01-26T20:35:18+00:00" + "time": "2021-03-02T16:53:12+00:00" }, { "name": "lcobucci/clock", @@ -2170,16 +2170,16 @@ }, { "name": "lcobucci/jwt", - "version": "4.1.0", + "version": "4.1.2", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "2f533837091d0b76a89a059e7ed2b2732b2f459e" + "reference": "c544710aa18e079baf0027ca4c8236913f46945b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/2f533837091d0b76a89a059e7ed2b2732b2f459e", - "reference": "2f533837091d0b76a89a059e7ed2b2732b2f459e", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c544710aa18e079baf0027ca4c8236913f46945b", + "reference": "c544710aa18e079baf0027ca4c8236913f46945b", "shasum": "" }, "require": { @@ -2228,7 +2228,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.1.0" + "source": "https://github.com/lcobucci/jwt/tree/4.1.2" }, "funding": [ { @@ -2240,7 +2240,7 @@ "type": "patreon" } ], - "time": "2021-01-28T00:57:26+00:00" + "time": "2021-02-19T19:37:15+00:00" }, { "name": "league/commonmark", @@ -2967,16 +2967,16 @@ }, { "name": "nesbot/carbon", - "version": "2.45.1", + "version": "2.46.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "528783b188bdb853eb21239b1722831e0f000a8d" + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/528783b188bdb853eb21239b1722831e0f000a8d", - "reference": "528783b188bdb853eb21239b1722831e0f000a8d", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", "shasum": "" }, "require": { @@ -3056,7 +3056,7 @@ "type": "tidelift" } ], - "time": "2021-02-11T18:30:17+00:00" + "time": "2021-02-24T17:30:44+00:00" }, { "name": "nikic/php-parser", @@ -3436,27 +3436,22 @@ }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -3469,7 +3464,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -3483,9 +3478,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/event-dispatcher", @@ -3745,16 +3740,16 @@ }, { "name": "psy/psysh", - "version": "v0.10.6", + "version": "v0.10.7", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "6f990c19f91729de8b31e639d6e204ea59f19cf3" + "reference": "a395af46999a12006213c0c8346c9445eb31640c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/6f990c19f91729de8b31e639d6e204ea59f19cf3", - "reference": "6f990c19f91729de8b31e639d6e204ea59f19cf3", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a395af46999a12006213c0c8346c9445eb31640c", + "reference": "a395af46999a12006213c0c8346c9445eb31640c", "shasum": "" }, "require": { @@ -3815,9 +3810,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.6" + "source": "https://github.com/bobthecow/psysh/tree/v0.10.7" }, - "time": "2021-01-18T15:53:43+00:00" + "time": "2021-03-14T02:14:56+00:00" }, { "name": "ralouphie/getallheaders", @@ -4230,20 +4225,21 @@ }, { "name": "spatie/image", - "version": "1.10.2", + "version": "1.10.4", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "12662673fbe649bffcd3a24188a404dc31fa118c" + "reference": "7ea129bc7b7521864c5a540e3b1c14ea194316d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/12662673fbe649bffcd3a24188a404dc31fa118c", - "reference": "12662673fbe649bffcd3a24188a404dc31fa118c", + "url": "https://api.github.com/repos/spatie/image/zipball/7ea129bc7b7521864c5a540e3b1c14ea194316d3", + "reference": "7ea129bc7b7521864c5a540e3b1c14ea194316d3", "shasum": "" }, "require": { "ext-exif": "*", + "ext-json": "*", "ext-mbstring": "*", "league/glide": "^1.6", "php": "^7.2|^8.0", @@ -4253,7 +4249,8 @@ }, "require-dev": { "phpunit/phpunit": "^8.0|^9.0", - "symfony/var-dumper": "^4.0|^5.0" + "symfony/var-dumper": "^4.0|^5.0", + "vimeo/psalm": "^4.6" }, "type": "library", "autoload": { @@ -4281,7 +4278,7 @@ ], "support": { "issues": "https://github.com/spatie/image/issues", - "source": "https://github.com/spatie/image/tree/1.10.2" + "source": "https://github.com/spatie/image/tree/1.10.4" }, "funding": [ { @@ -4293,7 +4290,7 @@ "type": "github" } ], - "time": "2021-01-26T07:53:19+00:00" + "time": "2021-03-10T16:11:40+00:00" }, { "name": "spatie/image-optimizer", @@ -4402,20 +4399,20 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.5", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7" + "reference": "15f7faf8508e04471f666633addacf54c0ab5933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/698a6a9f54d7eb321274de3ad19863802c879fb7", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/15f7faf8508e04471f666633addacf54c0ab5933", + "reference": "15f7faf8508e04471f666633addacf54c0ab5933", "shasum": "" }, "require": { - "egulias/email-validator": "^2.0", + "egulias/email-validator": "^2.0|^3.1", "php": ">=7.0.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-intl-idn": "^1.10", @@ -4461,7 +4458,7 @@ ], "support": { "issues": "https://github.com/swiftmailer/swiftmailer/issues", - "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.5" + "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.7" }, "funding": [ { @@ -4473,20 +4470,20 @@ "type": "tidelift" } ], - "time": "2021-01-12T09:35:59+00:00" + "time": "2021-03-09T12:30:35+00:00" }, { "name": "symfony/console", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a" + "reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/89d4b176d12a2946a1ae4e34906a025b7b6b135a", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a", + "url": "https://api.github.com/repos/symfony/console/zipball/938ebbadae1b0a9c9d1ec313f87f9708609f1b79", + "reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79", "shasum": "" }, "require": { @@ -4554,7 +4551,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.3" + "source": "https://github.com/symfony/console/tree/v5.2.5" }, "funding": [ { @@ -4570,11 +4567,11 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-03-06T13:42:15+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -4619,7 +4616,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.2.3" + "source": "https://github.com/symfony/css-selector/tree/v5.2.4" }, "funding": [ { @@ -4706,16 +4703,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "48f18b3609e120ea66d59142c23dc53e9562c26d" + "reference": "b547d3babcab5c31e01de59ee33e9d9c1421d7d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/48f18b3609e120ea66d59142c23dc53e9562c26d", - "reference": "48f18b3609e120ea66d59142c23dc53e9562c26d", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/b547d3babcab5c31e01de59ee33e9d9c1421d7d0", + "reference": "b547d3babcab5c31e01de59ee33e9d9c1421d7d0", "shasum": "" }, "require": { @@ -4755,7 +4752,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.2.3" + "source": "https://github.com/symfony/error-handler/tree/v5.2.4" }, "funding": [ { @@ -4771,20 +4768,20 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-02-11T08:21:20+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367" + "reference": "d08d6ec121a425897951900ab692b612a61d6240" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f9760f8074978ad82e2ce854dff79a71fe45367", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d08d6ec121a425897951900ab692b612a61d6240", + "reference": "d08d6ec121a425897951900ab692b612a61d6240", "shasum": "" }, "require": { @@ -4840,7 +4837,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.4" }, "funding": [ { @@ -4856,7 +4853,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:36:42+00:00" + "time": "2021-02-18T17:12:37+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4939,16 +4936,16 @@ }, { "name": "symfony/finder", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4adc8d172d602008c204c2e16956f99257248e03" + "reference": "0d639a0943822626290d169965804f79400e6a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4adc8d172d602008c204c2e16956f99257248e03", - "reference": "4adc8d172d602008c204c2e16956f99257248e03", + "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", + "reference": "0d639a0943822626290d169965804f79400e6a04", "shasum": "" }, "require": { @@ -4980,7 +4977,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.3" + "source": "https://github.com/symfony/finder/tree/v5.2.4" }, "funding": [ { @@ -4996,7 +4993,7 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-02-15T18:55:04+00:00" }, { "name": "symfony/http-client-contracts", @@ -5079,16 +5076,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36" + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/20c554c0f03f7cde5ce230ed248470cccbc34c36", - "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/54499baea7f7418bce7b5ec92770fd0799e8e9bf", + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf", "shasum": "" }, "require": { @@ -5132,7 +5129,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.2.3" + "source": "https://github.com/symfony/http-foundation/tree/v5.2.4" }, "funding": [ { @@ -5148,20 +5145,20 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:42:09+00:00" + "time": "2021-02-25T17:16:57+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05" + "reference": "b8c63ef63c2364e174c3b3e0ba0bf83455f97f73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05", - "reference": "89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b8c63ef63c2364e174c3b3e0ba0bf83455f97f73", + "reference": "b8c63ef63c2364e174c3b3e0ba0bf83455f97f73", "shasum": "" }, "require": { @@ -5196,7 +5193,7 @@ "psr/log-implementation": "1.0" }, "require-dev": { - "psr/cache": "~1.0", + "psr/cache": "^1.0|^2.0|^3.0", "symfony/browser-kit": "^4.4|^5.0", "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", @@ -5244,7 +5241,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.2.3" + "source": "https://github.com/symfony/http-kernel/tree/v5.2.5" }, "funding": [ { @@ -5260,20 +5257,20 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:51:58+00:00" + "time": "2021-03-10T17:07:35+00:00" }, { "name": "symfony/mime", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7dee6a43493f39b51ff6c5bb2bd576fe40a76c86" + "reference": "554ba128f1955038b45db5e1fa7e93bfc683b139" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7dee6a43493f39b51ff6c5bb2bd576fe40a76c86", - "reference": "7dee6a43493f39b51ff6c5bb2bd576fe40a76c86", + "url": "https://api.github.com/repos/symfony/mime/zipball/554ba128f1955038b45db5e1fa7e93bfc683b139", + "reference": "554ba128f1955038b45db5e1fa7e93bfc683b139", "shasum": "" }, "require": { @@ -5284,12 +5281,13 @@ "symfony/polyfill-php80": "^1.15" }, "conflict": { + "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4" }, "require-dev": { - "egulias/email-validator": "^2.1.10", + "egulias/email-validator": "^2.1.10|^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/property-access": "^4.4|^5.1", @@ -5326,7 +5324,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.2.3" + "source": "https://github.com/symfony/mime/tree/v5.2.5" }, "funding": [ { @@ -5342,11 +5340,11 @@ "type": "tidelift" } ], - "time": "2021-02-02T06:10:15+00:00" + "time": "2021-03-07T16:08:20+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -5405,7 +5403,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" }, "funding": [ { @@ -5425,16 +5423,16 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6" + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6", - "reference": "b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", "shasum": "" }, "require": { @@ -5485,7 +5483,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.1" }, "funding": [ { @@ -5501,20 +5499,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", "shasum": "" }, "require": { @@ -5566,7 +5564,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" }, "funding": [ { @@ -5582,20 +5580,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44" + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44", - "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", "shasum": "" }, "require": { @@ -5653,7 +5651,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" }, "funding": [ { @@ -5669,20 +5667,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba" + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", "shasum": "" }, "require": { @@ -5737,7 +5735,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" }, "funding": [ { @@ -5753,20 +5751,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T17:09:11+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", "shasum": "" }, "require": { @@ -5817,7 +5815,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" }, "funding": [ { @@ -5833,11 +5831,11 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -5893,7 +5891,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" }, "funding": [ { @@ -5913,7 +5911,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -5972,7 +5970,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" }, "funding": [ { @@ -5992,7 +5990,7 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", @@ -6055,7 +6053,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" }, "funding": [ { @@ -6075,7 +6073,7 @@ }, { "name": "symfony/process", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -6117,7 +6115,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.3" + "source": "https://github.com/symfony/process/tree/v5.2.4" }, "funding": [ { @@ -6137,16 +6135,16 @@ }, { "name": "symfony/routing", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661" + "reference": "cafa138128dfd6ab6be1abf6279169957b34f662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/348b5917e56546c6d96adbf21d7f92c9ef563661", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661", + "url": "https://api.github.com/repos/symfony/routing/zipball/cafa138128dfd6ab6be1abf6279169957b34f662", + "reference": "cafa138128dfd6ab6be1abf6279169957b34f662", "shasum": "" }, "require": { @@ -6207,7 +6205,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.2.3" + "source": "https://github.com/symfony/routing/tree/v5.2.4" }, "funding": [ { @@ -6223,7 +6221,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-02-22T15:48:39+00:00" }, { "name": "symfony/service-contracts", @@ -6306,16 +6304,16 @@ }, { "name": "symfony/string", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c95468897f408dd0aca2ff582074423dd0455122" + "reference": "4e78d7d47061fa183639927ec40d607973699609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", - "reference": "c95468897f408dd0aca2ff582074423dd0455122", + "url": "https://api.github.com/repos/symfony/string/zipball/4e78d7d47061fa183639927ec40d607973699609", + "reference": "4e78d7d47061fa183639927ec40d607973699609", "shasum": "" }, "require": { @@ -6369,7 +6367,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.3" + "source": "https://github.com/symfony/string/tree/v5.2.4" }, "funding": [ { @@ -6385,20 +6383,20 @@ "type": "tidelift" } ], - "time": "2021-01-25T15:14:59+00:00" + "time": "2021-02-16T10:20:28+00:00" }, { "name": "symfony/translation", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "c021864d4354ee55160ddcfd31dc477a1bc77949" + "reference": "0947ab1e3aabd22a6bef393874b2555d2bb976da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/c021864d4354ee55160ddcfd31dc477a1bc77949", - "reference": "c021864d4354ee55160ddcfd31dc477a1bc77949", + "url": "https://api.github.com/repos/symfony/translation/zipball/0947ab1e3aabd22a6bef393874b2555d2bb976da", + "reference": "0947ab1e3aabd22a6bef393874b2555d2bb976da", "shasum": "" }, "require": { @@ -6415,7 +6413,7 @@ "symfony/yaml": "<4.4" }, "provide": { - "symfony/translation-implementation": "2.0" + "symfony/translation-implementation": "2.3" }, "require-dev": { "psr/log": "~1.0", @@ -6462,7 +6460,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.2.3" + "source": "https://github.com/symfony/translation/tree/v5.2.5" }, "funding": [ { @@ -6478,7 +6476,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-06T07:59:01+00:00" }, { "name": "symfony/translation-contracts", @@ -6560,16 +6558,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694" + "reference": "002ab5a36702adf0c9a11e6d8836623253e9045e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/72ca213014a92223a5d18651ce79ef441c12b694", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/002ab5a36702adf0c9a11e6d8836623253e9045e", + "reference": "002ab5a36702adf0c9a11e6d8836623253e9045e", "shasum": "" }, "require": { @@ -6628,7 +6626,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v5.2.5" }, "funding": [ { @@ -6644,7 +6642,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-06T07:59:01+00:00" }, { "name": "tgalopin/html-sanitizer", @@ -6903,30 +6901,35 @@ }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -6950,9 +6953,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ @@ -7199,16 +7202,16 @@ }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.9.0", + "version": "v2.9.1", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "64a6b902583802c162cdccf7e76dc8619368bf1a" + "reference": "8d8302ff6adb55f8b844c798b8b1ffdee142f7e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/64a6b902583802c162cdccf7e76dc8619368bf1a", - "reference": "64a6b902583802c162cdccf7e76dc8619368bf1a", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/8d8302ff6adb55f8b844c798b8b1ffdee142f7e5", + "reference": "8d8302ff6adb55f8b844c798b8b1ffdee142f7e5", "shasum": "" }, "require": { @@ -7219,6 +7222,7 @@ "illuminate/console": "^8", "illuminate/filesystem": "^8", "illuminate/support": "^8", + "nikic/php-parser": "^4.7", "php": "^7.3 || ^8.0", "phpdocumentor/type-resolver": "^1.1.0" }, @@ -7233,6 +7237,9 @@ "spatie/phpunit-snapshot-assertions": "^3 || ^4", "vimeo/psalm": "^3.12" }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8)." + }, "type": "library", "extra": { "branch-alias": { @@ -7273,7 +7280,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", - "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.9.0" + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.9.1" }, "funding": [ { @@ -7281,7 +7288,7 @@ "type": "github" } ], - "time": "2020-12-29T10:11:05+00:00" + "time": "2021-03-15T19:22:08+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -7478,16 +7485,16 @@ }, { "name": "composer/composer", - "version": "2.0.9", + "version": "2.0.11", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "591c2c155cac0d2d7f34af41d3b1e29bcbfc685e" + "reference": "a5a5632da0b1c2d6fa9a3b65f1f4e90d1f04abb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/591c2c155cac0d2d7f34af41d3b1e29bcbfc685e", - "reference": "591c2c155cac0d2d7f34af41d3b1e29bcbfc685e", + "url": "https://api.github.com/repos/composer/composer/zipball/a5a5632da0b1c2d6fa9a3b65f1f4e90d1f04abb9", + "reference": "a5a5632da0b1c2d6fa9a3b65f1f4e90d1f04abb9", "shasum": "" }, "require": { @@ -7555,7 +7562,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.0.9" + "source": "https://github.com/composer/composer/tree/2.0.11" }, "funding": [ { @@ -7571,7 +7578,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T15:09:27+00:00" + "time": "2021-02-24T13:57:23+00:00" }, { "name": "composer/package-versions-deprecated", @@ -8245,16 +8252,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.3.7", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "fd688d3c06658f2b3b5f7bb19f051ee4ddf02492" + "reference": "ef0f5bce23b30b32d98fd9bb49c6fa37b40eb546" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/fd688d3c06658f2b3b5f7bb19f051ee4ddf02492", - "reference": "fd688d3c06658f2b3b5f7bb19f051ee4ddf02492", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/ef0f5bce23b30b32d98fd9bb49c6fa37b40eb546", + "reference": "ef0f5bce23b30b32d98fd9bb49c6fa37b40eb546", "shasum": "" }, "require": { @@ -8298,7 +8305,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.3.7" + "source": "https://github.com/facade/flare-client-php/tree/1.4.0" }, "funding": [ { @@ -8306,20 +8313,20 @@ "type": "github" } ], - "time": "2020-10-21T16:02:39+00:00" + "time": "2021-02-16T12:42:06+00:00" }, { "name": "facade/ignition", - "version": "2.5.11", + "version": "2.5.14", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "e91d67353054bf827c64687fcac5ea44e4dcec54" + "reference": "17097f7a83e200d90d1cf9f4d1b35c1001513a47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/e91d67353054bf827c64687fcac5ea44e4dcec54", - "reference": "e91d67353054bf827c64687fcac5ea44e4dcec54", + "url": "https://api.github.com/repos/facade/ignition/zipball/17097f7a83e200d90d1cf9f4d1b35c1001513a47", + "reference": "17097f7a83e200d90d1cf9f4d1b35c1001513a47", "shasum": "" }, "require": { @@ -8383,7 +8390,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2021-02-05T12:52:11+00:00" + "time": "2021-03-04T08:48:01+00:00" }, { "name": "facade/ignition-contracts", @@ -8537,16 +8544,16 @@ }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541" + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/85e83cacd2ed573238678c6875f8f0d7ec699541", - "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", "shasum": "" }, "require": { @@ -8587,22 +8594,22 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.0" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" }, - "time": "2020-10-23T13:55:30+00:00" + "time": "2021-02-22T14:02:09+00:00" }, { "name": "filp/whoops", - "version": "2.9.2", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "df7933820090489623ce0be5e85c7e693638e536" + "reference": "6ecda5217bf048088b891f7403b262906be5a957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536", - "reference": "df7933820090489623ce0be5e85c7e693638e536", + "url": "https://api.github.com/repos/filp/whoops/zipball/6ecda5217bf048088b891f7403b262906be5a957", + "reference": "6ecda5217bf048088b891f7403b262906be5a957", "shasum": "" }, "require": { @@ -8652,7 +8659,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.9.2" + "source": "https://github.com/filp/whoops/tree/2.10.0" }, "funding": [ { @@ -8660,7 +8667,7 @@ "type": "github" } ], - "time": "2021-01-24T12:00:00+00:00" + "time": "2021-03-16T12:00:00+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8785,16 +8792,16 @@ }, { "name": "laravel/dusk", - "version": "v6.11.3", + "version": "v6.13.0", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "040c8ee2b8fae416843973565dbbcee75b6e84f4" + "reference": "59f9febbaf9559a8a744187f38c53bbd425edd93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/040c8ee2b8fae416843973565dbbcee75b6e84f4", - "reference": "040c8ee2b8fae416843973565dbbcee75b6e84f4", + "url": "https://api.github.com/repos/laravel/dusk/zipball/59f9febbaf9559a8a744187f38c53bbd425edd93", + "reference": "59f9febbaf9559a8a744187f38c53bbd425edd93", "shasum": "" }, "require": { @@ -8812,6 +8819,7 @@ }, "require-dev": { "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.16|^5.17.1|^6.12.1", "phpunit/phpunit": "^7.5.15|^8.4|^9.0" }, "suggest": { @@ -8851,9 +8859,9 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.11.3" + "source": "https://github.com/laravel/dusk/tree/v6.13.0" }, - "time": "2021-02-09T16:14:48+00:00" + "time": "2021-02-23T20:28:11+00:00" }, { "name": "maximebf/debugbar", @@ -8922,16 +8930,16 @@ }, { "name": "mockery/mockery", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "20cab678faed06fac225193be281ea0fddb43b93" + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/20cab678faed06fac225193be281ea0fddb43b93", - "reference": "20cab678faed06fac225193be281ea0fddb43b93", + "url": "https://api.github.com/repos/mockery/mockery/zipball/d1339f64479af1bee0e82a0413813fe5345a54ea", + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea", "shasum": "" }, "require": { @@ -8988,9 +8996,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/master" + "source": "https://github.com/mockery/mockery/tree/1.4.3" }, - "time": "2020-08-11T18:10:13+00:00" + "time": "2021-02-24T09:51:49+00:00" }, { "name": "myclabs/deep-copy", @@ -9304,16 +9312,16 @@ }, { "name": "phar-io/version", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -9349,22 +9357,22 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.0.4" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2020-12-13T23:18:30+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "php-webdriver/webdriver", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "e3633154554605274cc9d59837f55a7427d72003" + "reference": "cd9290b95b7651d495bd69253d6e3ef469a7f211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/e3633154554605274cc9d59837f55a7427d72003", - "reference": "e3633154554605274cc9d59837f55a7427d72003", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/cd9290b95b7651d495bd69253d6e3ef469a7f211", + "reference": "cd9290b95b7651d495bd69253d6e3ef469a7f211", "shasum": "" }, "require": { @@ -9380,7 +9388,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", - "ondram/ci-detector": "^2.1 || ^3.5", + "ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", "php-coveralls/php-coveralls": "^2.4", "php-mock/php-mock-phpunit": "^1.1 || ^2.0", "php-parallel-lint/php-parallel-lint": "^1.2", @@ -9420,9 +9428,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.9.0" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.10.0" }, - "time": "2020-11-19T15:21:05+00:00" + "time": "2021-02-25T13:38:09+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9584,16 +9592,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", "shasum": "" }, "require": { @@ -9645,9 +9653,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" }, - "time": "2020-12-19T10:15:11+00:00" + "time": "2021-03-17T13:42:18+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9969,16 +9977,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.2", + "version": "9.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4" + "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/27241ac75fc37ecf862b6e002bf713b6566cbe41", + "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41", "shasum": "" }, "require": { @@ -10056,7 +10064,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.3" }, "funding": [ { @@ -10068,7 +10076,7 @@ "type": "github" } ], - "time": "2021-02-02T14:45:58+00:00" + "time": "2021-03-17T07:30:34+00:00" }, { "name": "react/promise", @@ -11259,16 +11267,16 @@ }, { "name": "spatie/laravel-ray", - "version": "1.12.6", + "version": "1.17.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ray.git", - "reference": "9774088a826cc5aaa2710720667047852b2a5538" + "reference": "c25f2c2cdf3221abce3b1250cb7296721acfd2b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/9774088a826cc5aaa2710720667047852b2a5538", - "reference": "9774088a826cc5aaa2710720667047852b2a5538", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/c25f2c2cdf3221abce3b1250cb7296721acfd2b8", + "reference": "c25f2c2cdf3221abce3b1250cb7296721acfd2b8", "shasum": "" }, "require": { @@ -11279,7 +11287,7 @@ "illuminate/support": "^7.20|^8.13", "php": "^7.3|^8.0", "spatie/backtrace": "^1.0", - "spatie/ray": "^1.19", + "spatie/ray": "^1.21.2", "symfony/stopwatch": "4.2|^5.1", "zbateson/mail-mime-parser": "^1.3.1" }, @@ -11323,7 +11331,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.12.6" + "source": "https://github.com/spatie/laravel-ray/tree/1.17.1" }, "funding": [ { @@ -11335,7 +11343,7 @@ "type": "other" } ], - "time": "2021-02-10T19:13:17+00:00" + "time": "2021-03-13T12:50:02+00:00" }, { "name": "spatie/macroable", @@ -11389,16 +11397,16 @@ }, { "name": "spatie/ray", - "version": "1.19.4", + "version": "1.21.2", "source": { "type": "git", "url": "https://github.com/spatie/ray.git", - "reference": "fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6" + "reference": "829676b1b6791aba6660fcca6f553d72c894a0ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6", - "reference": "fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6", + "url": "https://api.github.com/repos/spatie/ray/zipball/829676b1b6791aba6660fcca6f553d72c894a0ae", + "reference": "829676b1b6791aba6660fcca6f553d72c894a0ae", "shasum": "" }, "require": { @@ -11406,7 +11414,7 @@ "ext-json": "*", "php": "^7.3|^8.0", "ramsey/uuid": "^3.0|^4.1", - "spatie/backtrace": "^1.0", + "spatie/backtrace": "^1.1", "spatie/macroable": "^1.0", "symfony/stopwatch": "^4.0|^5.1", "symfony/var-dumper": "^4.2|^5.1" @@ -11448,7 +11456,7 @@ ], "support": { "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.19.4" + "source": "https://github.com/spatie/ray/tree/1.21.2" }, "funding": [ { @@ -11460,20 +11468,20 @@ "type": "other" } ], - "time": "2021-02-11T08:10:15+00:00" + "time": "2021-03-04T11:06:19+00:00" }, { "name": "symfony/debug", - "version": "v4.4.19", + "version": "v4.4.20", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "af4987aa4a5630e9615be9d9c3ed1b0f24ca449c" + "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/af4987aa4a5630e9615be9d9c3ed1b0f24ca449c", - "reference": "af4987aa4a5630e9615be9d9c3ed1b0f24ca449c", + "url": "https://api.github.com/repos/symfony/debug/zipball/157bbec4fd773bae53c5483c50951a5530a2cc16", + "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16", "shasum": "" }, "require": { @@ -11513,7 +11521,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.19" + "source": "https://github.com/symfony/debug/tree/v4.4.20" }, "funding": [ { @@ -11529,20 +11537,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-01-28T16:54:48+00:00" }, { "name": "symfony/filesystem", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038" + "reference": "710d364200997a5afde34d9fe57bd52f3cc1e108" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/262d033b57c73e8b59cd6e68a45c528318b15038", - "reference": "262d033b57c73e8b59cd6e68a45c528318b15038", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/710d364200997a5afde34d9fe57bd52f3cc1e108", + "reference": "710d364200997a5afde34d9fe57bd52f3cc1e108", "shasum": "" }, "require": { @@ -11575,7 +11583,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.2.3" + "source": "https://github.com/symfony/filesystem/tree/v5.2.4" }, "funding": [ { @@ -11591,11 +11599,11 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-02-12T10:38:38+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -11637,7 +11645,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.3" + "source": "https://github.com/symfony/stopwatch/tree/v5.2.4" }, "funding": [ { @@ -11707,20 +11715,20 @@ }, { "name": "vimeo/psalm", - "version": "4.5.2", + "version": "4.6.4", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "15a9eece1305fd26eb1336a78e5a2ee7a4b36214" + "reference": "97fe86c4e158b5a57c5150aa5055c38b5a809aab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/15a9eece1305fd26eb1336a78e5a2ee7a4b36214", - "reference": "15a9eece1305fd26eb1336a78e5a2ee7a4b36214", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/97fe86c4e158b5a57c5150aa5055c38b5a809aab", + "reference": "97fe86c4e158b5a57c5150aa5055c38b5a809aab", "shasum": "" }, "require": { - "amphp/amp": "^2.1", + "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", @@ -11733,8 +11741,8 @@ "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.10.1", "openlss/lib-array2xml": "^1.0", "php": "^7.1|^8", @@ -11746,7 +11754,6 @@ "psalm/psalm": "self.version" }, "require-dev": { - "amphp/amp": "^2.4.2", "bamarni/composer-bin-plugin": "^1.2", "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", @@ -11806,9 +11813,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.5.2" + "source": "https://github.com/vimeo/psalm/tree/4.6.4" }, - "time": "2021-02-13T21:45:13+00:00" + "time": "2021-03-16T23:28:18+00:00" }, { "name": "webmozart/path-util", diff --git a/phpunit.xml b/phpunit.xml index 0e065660..3fd13959 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,8 @@ - diff --git a/tests/Feature/ActivityStreamTest.php b/tests/Feature/ActivityStreamTest.php index be97dcb2..e00aa495 100644 --- a/tests/Feature/ActivityStreamTest.php +++ b/tests/Feature/ActivityStreamTest.php @@ -1,18 +1,16 @@ get('/', ['Accept' => 'application/activity+json']); $response->assertHeader('Content-Type', 'application/activity+json'); @@ -24,14 +22,10 @@ class ActivityStreamTest extends TestCase ]); } - /** - * Test request to a single note returns AS2.0 data. - * - * @return void - */ - public function test_single_note_returns_as_data() + /** @test */ + public function requestForNoteIncludesActivityStreamData(): void { - $note = \App\Models\Note::find(11); + $note = Note::find(11); $response = $this->get('/notes/B', ['Accept' => 'application/activity+json']); $response->assertHeader('Content-Type', 'application/activity+json'); $response->assertJson([ diff --git a/tests/Feature/Admin/AdminHomeControllerTest.php b/tests/Feature/Admin/AdminHomeControllerTest.php index 4bb06062..af7f0e24 100644 --- a/tests/Feature/Admin/AdminHomeControllerTest.php +++ b/tests/Feature/Admin/AdminHomeControllerTest.php @@ -1,16 +1,19 @@ make(); diff --git a/tests/Feature/Admin/AdminTest.php b/tests/Feature/Admin/AdminTest.php index c90ba21a..4ae91055 100644 --- a/tests/Feature/Admin/AdminTest.php +++ b/tests/Feature/Admin/AdminTest.php @@ -1,24 +1,29 @@ get('/admin'); $response->assertRedirect('/login'); } - public function test_login_page() + /** @test */ + public function loginPageLoads(): void { $response = $this->get('/login'); $response->assertViewIs('login'); } - public function test_attempt_login_with_bad_credentials() + /** @test */ + public function loginAttemptWithBadCredentialsFails(): void { $response = $this->post('/login', [ 'username' => 'bad', diff --git a/tests/Feature/Admin/ArticlesTest.php b/tests/Feature/Admin/ArticlesTest.php index c873a9c8..bdb8d60e 100644 --- a/tests/Feature/Admin/ArticlesTest.php +++ b/tests/Feature/Admin/ArticlesTest.php @@ -1,17 +1,21 @@ make(); @@ -20,7 +24,8 @@ class ArticlesTest extends TestCase $response->assertSeeText('Select article to edit:'); } - public function test_create_page() + /** @test */ + public function adminCanLoadFormToCreateArticle(): void { $user = User::factory()->make(); @@ -29,7 +34,8 @@ class ArticlesTest extends TestCase $response->assertSeeText('Title (URL)'); } - public function test_create_new_article() + /** @test */ + public function admiNCanCreateNewArticle(): void { $user = User::factory()->make(); @@ -41,10 +47,11 @@ class ArticlesTest extends TestCase $this->assertDatabaseHas('articles', ['title' => 'Test Title']); } - public function test_create_new_article_with_upload() + /** @test */ + public function adminCanCreateNewArticleWithFile(): void { $user = User::factory()->make(); - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $text = $faker->text; if ($fh = fopen(sys_get_temp_dir() . '/article.md', 'w')) { fwrite($fh, $text); @@ -65,7 +72,8 @@ class ArticlesTest extends TestCase ]); } - public function test_see_edit_form() + /** @test */ + public function articleCanLoadFormToEditArticle(): void { $user = User::factory()->make(); @@ -74,7 +82,8 @@ class ArticlesTest extends TestCase $response->assertSeeText('This is *my* new blog. It uses `Markdown`.'); } - public function test_edit_article() + /** @test */ + public function adminCanEditArticle(): void { $user = User::factory()->make(); @@ -90,7 +99,8 @@ class ArticlesTest extends TestCase ]); } - public function test_delete_article() + /** @test */ + public function adminCanDeleteArticle(): void { $user = User::factory()->make(); diff --git a/tests/Feature/Admin/ClientsTest.php b/tests/Feature/Admin/ClientsTest.php index ba598012..2ca70b2f 100644 --- a/tests/Feature/Admin/ClientsTest.php +++ b/tests/Feature/Admin/ClientsTest.php @@ -1,16 +1,19 @@ make(); @@ -19,7 +22,8 @@ class ClientsTest extends TestCase $response->assertSeeText('Clients'); } - public function test_create_page() + /** @test */ + public function adminCanLoadFormToCreateClient(): void { $user = User::factory()->make(); @@ -28,7 +32,8 @@ class ClientsTest extends TestCase $response->assertSeeText('New Client'); } - public function test_create_new_client() + /** @test */ + public function adminCanCreateNewClient(): void { $user = User::factory()->make(); @@ -43,7 +48,8 @@ class ClientsTest extends TestCase ]); } - public function test_see_edit_form() + /** @test */ + public function adminCanLoadEditFormForClient(): void { $user = User::factory()->make(); @@ -52,7 +58,8 @@ class ClientsTest extends TestCase $response->assertSee('https://jbl5.dev/notes/new'); } - public function test_edit_client() + /** @test */ + public function adminCanEditClient(): void { $user = User::factory()->make(); @@ -68,7 +75,8 @@ class ClientsTest extends TestCase ]); } - public function test_delete_client() + /** @test */ + public function adminCanDeleteClient(): void { $user = User::factory()->make(); diff --git a/tests/Feature/Admin/ContactsTest.php b/tests/Feature/Admin/ContactsTest.php index 05dac0e4..65bbe85d 100644 --- a/tests/Feature/Admin/ContactsTest.php +++ b/tests/Feature/Admin/ContactsTest.php @@ -1,16 +1,18 @@ make(); @@ -33,7 +36,8 @@ class ContactsTest extends TestCase $response->assertViewIs('admin.contacts.index'); } - public function test_create_page() + /** @test */ + public function contactCreatePageLoads(): void { $user = User::factory()->make(); @@ -41,7 +45,8 @@ class ContactsTest extends TestCase $response->assertViewIs('admin.contacts.create'); } - public function test_create_new_contact() + /** @test */ + public function adminCanCreateNewContact(): void { $user = User::factory()->make(); @@ -57,7 +62,8 @@ class ContactsTest extends TestCase ]); } - public function test_see_edit_form() + /** @test */ + public function adminCanSeeFormToEditContact(): void { $user = User::factory()->make(); @@ -65,7 +71,8 @@ class ContactsTest extends TestCase $response->assertViewIs('admin.contacts.edit'); } - public function test_update_contact_no_uploaded_avatar() + /** @test */ + public function adminCanUpdateContact(): void { $user = User::factory()->make(); @@ -82,7 +89,8 @@ class ContactsTest extends TestCase ]); } - public function test_edit_contact_with_uploaded_avatar() + /** @test */ + public function adminCanEditContactAndUploadAvatar(): void { copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png'); $path = sys_get_temp_dir() . '/tantek.png'; @@ -103,7 +111,8 @@ class ContactsTest extends TestCase ); } - public function test_delete_contact() + /** @test */ + public function adminCanDeleteContact(): void { $user = User::factory()->make(); @@ -115,13 +124,14 @@ class ContactsTest extends TestCase ]); } - public function test_get_avatar_method() + /** @test */ + public function adminCanTriggerRetrievalOfRemoteAvatar(): void { $html = << - - -HTML; +
+ +
+ HTML; $file = fopen(__DIR__ . '/../../aaron.png', 'r'); $mock = new MockHandler([ new Response(200, ['Content-Type' => 'text/html'], $html), @@ -140,7 +150,8 @@ HTML; ); } - public function test_get_avatar_method_redirects_with_failed_homepage() + /** @test */ + public function gettingRemoteAvatarFailsGracefullyWithRemoteNotFound(): void { $mock = new MockHandler([ new Response(404), @@ -155,13 +166,14 @@ HTML; $response->assertRedirect('/admin/contacts/1/edit'); } - public function test_get_avatar_method_redirects_with_failed_avatar_download() + /** @test */ + public function gettingRemoteAvatarFailsGracefullyWithRemoteError(): void { $html = << - - -HTML; +
+ +
+ HTML; $mock = new MockHandler([ new Response(200, ['Content-Type' => 'text/html'], $html), new Response(404), @@ -176,7 +188,8 @@ HTML; $response->assertRedirect('/admin/contacts/1/edit'); } - public function test_get_avatar_for_contact_with_no_homepage() + /** @test */ + public function gettingRemoteAvatarFailsGracefullyForContactWithNoHompage(): void { $contact = Contact::create([ 'nick' => 'fred', diff --git a/tests/Feature/Admin/LikesTest.php b/tests/Feature/Admin/LikesTest.php index b6becca2..8cb57502 100644 --- a/tests/Feature/Admin/LikesTest.php +++ b/tests/Feature/Admin/LikesTest.php @@ -1,19 +1,22 @@ make(); @@ -22,7 +25,8 @@ class LikesTest extends TestCase $response->assertSeeText('Likes'); } - public function test_create_page() + /** @test */ + public function likeCreateFormLoads(): void { $user = User::factory()->make(); @@ -31,7 +35,8 @@ class LikesTest extends TestCase $response->assertSeeText('New Like'); } - public function test_create_new_like() + /** @test */ + public function adminCanCreateLike(): void { Queue::fake(); $user = User::factory()->make(); @@ -46,7 +51,8 @@ class LikesTest extends TestCase Queue::assertPushed(ProcessLike::class); } - public function test_see_edit_form() + /** @test */ + public function likeEditFormLoads(): void { $user = User::factory()->make(); @@ -55,7 +61,8 @@ class LikesTest extends TestCase $response->assertSee('Edit Like'); } - public function test_edit_like() + /** @test */ + public function adminCanEditLike(): void { Queue::fake(); $user = User::factory()->make(); @@ -71,7 +78,8 @@ class LikesTest extends TestCase Queue::assertPushed(ProcessLike::class); } - public function test_delete_like() + /** @test */ + public function adminCanDeleteLike(): void { $like = Like::find(1); $url = $like->url; diff --git a/tests/Feature/Admin/NotesTest.php b/tests/Feature/Admin/NotesTest.php index b9021a1f..8ce59173 100644 --- a/tests/Feature/Admin/NotesTest.php +++ b/tests/Feature/Admin/NotesTest.php @@ -1,18 +1,21 @@ make(); @@ -20,7 +23,8 @@ class NotesTest extends TestCase $response->assertViewIs('admin.notes.index'); } - public function test_create_page() + /** @test */ + public function noteCreatePageLoads(): void { $user = User::factory()->make(); @@ -28,7 +32,8 @@ class NotesTest extends TestCase $response->assertViewIs('admin.notes.create'); } - public function test_create_a_new_note() + /** @test */ + public function adminCanCreateNewNote(): void { $user = User::factory()->make(); @@ -40,7 +45,8 @@ class NotesTest extends TestCase ]); } - public function test_edit_page() + /** @test */ + public function noteEditFormLoads(): void { $user = User::factory()->make(); @@ -48,7 +54,8 @@ class NotesTest extends TestCase $response->assertViewIs('admin.notes.edit'); } - public function test_edit_a_note() + /** @test */ + public function adminCanEditNote(): void { Queue::fake(); $user = User::factory()->make(); @@ -65,7 +72,8 @@ class NotesTest extends TestCase Queue::assertPushed(SendWebMentions::class); } - public function test_delete_note() + /** @test */ + public function adminCanDeleteNote(): void { $user = User::factory()->make(); diff --git a/tests/Feature/Admin/PlacesTest.php b/tests/Feature/Admin/PlacesTest.php index 984f428c..910a7fe0 100644 --- a/tests/Feature/Admin/PlacesTest.php +++ b/tests/Feature/Admin/PlacesTest.php @@ -1,16 +1,19 @@ make(); @@ -18,7 +21,8 @@ class PlacesTest extends TestCase $response->assertViewIs('admin.places.index'); } - public function test_create_page() + /** @test */ + public function createPlacePageLoads(): void { $user = User::factory()->make(); @@ -26,7 +30,8 @@ class PlacesTest extends TestCase $response->assertViewIs('admin.places.create'); } - public function test_create_new_place() + /** @test */ + public function adminCanCreateNewPlace(): void { $user = User::factory()->make(); @@ -42,7 +47,8 @@ class PlacesTest extends TestCase ]); } - public function test_edit_page() + /** @test */ + public function editPlacePageLoads(): void { $user = User::factory()->make(); @@ -50,7 +56,8 @@ class PlacesTest extends TestCase $response->assertViewIs('admin.places.edit'); } - public function test_updating_a_place() + /** @test */ + public function adminCanUpdatePlace(): void { $user = User::factory()->make(); diff --git a/tests/Feature/ArticlesTest.php b/tests/Feature/ArticlesTest.php index 18ed7212..96aded01 100644 --- a/tests/Feature/ArticlesTest.php +++ b/tests/Feature/ArticlesTest.php @@ -1,45 +1,50 @@ get('/blog'); $response->assertViewIs('articles.index'); } - public function test_single_article() + /** @test */ + public function singleArticlePageLoads() { $response = $this->get('/blog/' . date('Y') . '/' . date('m') . '/some-code-i-did'); $response->assertViewIs('articles.show'); } - public function test_wrong_date_redirects() + /** @test */ + public function wrongDateInUrlRedirectsToCorrectDate() { $response = $this->get('/blog/1900/01/some-code-i-did'); $response->assertRedirect('/blog/' . date('Y') . '/' . date('m') . '/some-code-i-did'); } - public function test_redirect_for_id() + /** @test */ + public function oldUrlsWithIdAreRedirected() { $response = $this->get('/blog/s/2'); $response->assertRedirect('/blog/' . date('Y') . '/' . date('m') . '/some-code-i-did'); } /** @test */ - public function unknownSlugGives404() + public function unknownSlugGetsNotFoundResponse() { $response = $this->get('/blog/' . date('Y') . '/' . date('m') . '/unknown-slug'); $response->assertNotFound(); } /** @test */ - public function unknownArticleIdGives404() + public function unknownArticleIdGetsNotFoundResponse() { $response = $this->get('/blog/s/22'); $response->assertNotFound(); diff --git a/tests/Feature/BookmarksTest.php b/tests/Feature/BookmarksTest.php index 7b7521bc..d624563b 100644 --- a/tests/Feature/BookmarksTest.php +++ b/tests/Feature/BookmarksTest.php @@ -1,31 +1,36 @@ get('/bookmarks'); $response->assertViewIs('bookmarks.index'); } - public function test_single_bookmark_page() + /** @test */ + public function singleBookmarkPageLoadsWithoutError(): void { $response = $this->get('/bookmarks/1'); $response->assertViewIs('bookmarks.show'); } - public function test_browsershot_job_dispatches_when_bookmark_added_http_post_syntax() + /** @test */ + public function whenBookmarkIsAddedUsingHttpSyntaxCheckJobToTakeScreenshotIsInvoked(): void { Queue::fake(); @@ -46,7 +51,8 @@ class BookmarksTest extends TestCase $this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']); } - public function test_browsershot_job_dispatches_when_bookmark_added_json_syntax() + /** @test */ + public function whenBookmarkIsAddedUsingJsonSyntaxCheckJobToTakeScreenshotIsInvoked(): void { Queue::fake(); @@ -69,7 +75,8 @@ class BookmarksTest extends TestCase $this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']); } - public function test_single_twitter_syndication_target_causes_job_dispatch_http_post_syntax() + /** @test */ + public function whenTheBookmarkIsMarkedForPostingToTwitterCheckWeInvokeTheCorrectJob(): void { Queue::fake(); @@ -88,7 +95,8 @@ class BookmarksTest extends TestCase $this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']); } - public function test_tags_created_with_new_bookmark() + /** @test */ + public function whenTheBookmarkIsCreatedCheckNecessaryTagsAreAlsoCreated(): void { Queue::fake(); diff --git a/tests/Feature/BridgyPosseTest.php b/tests/Feature/BridgyPosseTest.php index a64b037b..d9ce2629 100644 --- a/tests/Feature/BridgyPosseTest.php +++ b/tests/Feature/BridgyPosseTest.php @@ -1,12 +1,15 @@ get('/notes/4'); diff --git a/tests/Feature/CSPHeadersTest.php b/tests/Feature/CSPHeadersTest.php index 1d558dbc..6957f034 100644 --- a/tests/Feature/CSPHeadersTest.php +++ b/tests/Feature/CSPHeadersTest.php @@ -1,5 +1,7 @@ get('/'); + $response = $this->get('/blog'); $response->assertHeader('Content-Security-Policy'); $response->assertHeader('Report-To'); } diff --git a/tests/Feature/ContactsTest.php b/tests/Feature/ContactsTest.php index b9d99af6..c4d1f5fa 100644 --- a/tests/Feature/ContactsTest.php +++ b/tests/Feature/ContactsTest.php @@ -1,5 +1,7 @@ get('/contacts'); $response->assertStatus(200); @@ -20,9 +22,9 @@ class ContactsTest extends TestCase /** * Test an individual contact page with default profile image. * - * @return void + * @test */ - public function test_contact_page_with_default_pic() + public function contactPageShouldFallbackToDefaultProfilePic(): void { $response = $this->get('/contacts/tantek'); $response->assertViewHas('image', '/assets/profile-images/default-image'); @@ -31,16 +33,16 @@ class ContactsTest extends TestCase /** * Test an individual contact page with a specific profile image. * - * @return void + * @test */ - public function test_contact_page_with_specific_pic() + public function contactPageShouldUseSpecificProfilePicIfPresent(): void { $response = $this->get('/contacts/aaron'); $response->assertViewHas('image', '/assets/profile-images/aaronparecki.com/image'); } /** @test */ - public function unknownContactGives404() + public function unknownContactReturnsNotFoundResponse(): void { $response = $this->get('/contacts/unknown'); $response->assertNotFound(); diff --git a/tests/Feature/CorsHeadersTest.php b/tests/Feature/CorsHeadersTest.php index 3d3ef924..7a5fdf05 100644 --- a/tests/Feature/CorsHeadersTest.php +++ b/tests/Feature/CorsHeadersTest.php @@ -1,18 +1,18 @@ call( 'OPTIONS', @@ -26,9 +26,9 @@ class CorsHeadersTest extends TestCase } /** @test */ - public function check_missing_on_other_route() + public function checkForNoCorsHeaderOnNonMediaEndpointLinks(): void { - $response = $this->get('/'); + $response = $this->get('/blog'); $response->assertHeaderMissing('Access-Control-Allow-Origin'); } } diff --git a/tests/Feature/FeedsTest.php b/tests/Feature/FeedsTest.php index 1c3c8bd2..b74952bd 100644 --- a/tests/Feature/FeedsTest.php +++ b/tests/Feature/FeedsTest.php @@ -1,5 +1,7 @@ get('/blog/feed.rss'); $response->assertHeader('Content-Type', 'application/rss+xml; charset=utf-8'); + $response->assertOk(); } /** * Test the notes RSS feed. * - * @return void + * @test */ - public function test_notes_rss_feed() + public function notesRssFeedIsPresent(): void { $response = $this->get('/notes/feed.rss'); $response->assertHeader('Content-Type', 'application/rss+xml; charset=utf-8'); + $response->assertOk(); } /** * Test the blog RSS feed. * - * @return void + * @test */ - public function test_blog_atom_feed() + public function blogAtomFeedIsPresent(): void { $response = $this->get('/blog/feed.atom'); $response->assertHeader('Content-Type', 'application/atom+xml; charset=utf-8'); + $response->assertOk(); } /** @test */ - public function blog_jf2_feed() + public function blogJf2FeedIsPresent(): void { $response = $this->get('/blog/feed.jf2'); $response->assertHeader('Content-Type', 'application/jf2feed+json'); @@ -63,38 +68,41 @@ class FeedsTest extends TestCase /** * Test the notes RSS feed. * - * @return void + * @test */ - public function test_notes_atom_feed() + public function notesAtomFeedIsPresent(): void { $response = $this->get('/notes/feed.atom'); $response->assertHeader('Content-Type', 'application/atom+xml; charset=utf-8'); + $response->assertOk(); } /** * Test the blog JSON feed. * - * @return void + * @test */ - public function test_blog_json_feed() + public function blogJsonFeedIsPresent(): void { $response = $this->get('/blog/feed.json'); $response->assertHeader('Content-Type', 'application/json'); + $response->assertOk(); } /** * Test the notes JSON feed. * - * @return void + * @test */ - public function test_notes_json_feed() + public function notesJsonFeedIsPresent(): void { $response = $this->get('/notes/feed.json'); $response->assertHeader('Content-Type', 'application/json'); + $response->assertOk(); } /** @test */ - public function notes_jf2_feed() + public function notesJf2FeedIsPresent(): void { $response = $this->get('/notes/feed.jf2'); $response->assertHeader('Content-Type', 'application/jf2feed+json'); @@ -118,9 +126,9 @@ class FeedsTest extends TestCase * Each JSON feed item must have one of `content_text` or `content_html`, * and whichever one they have can’t be `null`. * - * @return void + * @test */ - public function test_json_feed_has_one_content_attribute_and_it_isnt_null() + public function jsonFeedsHaveRequiredAttributes(): void { $response = $this->get('/notes/feed.json'); $data = json_decode($response->content()); diff --git a/tests/Feature/LikesTest.php b/tests/Feature/LikesTest.php index 8a3cdd7f..c33c005c 100644 --- a/tests/Feature/LikesTest.php +++ b/tests/Feature/LikesTest.php @@ -1,40 +1,43 @@ get('/likes'); $response->assertViewIs('likes.index'); } - public function test_single_like_page() + /** @test */ + public function singleLikePageHasCorrectView(): void { $response = $this->get('/likes/1'); $response->assertViewIs('likes.show'); } - public function test_like_micropub_json_request() + /** @test */ + public function checkLikeCreatedFromMicropubApiRequests(): void { Queue::fake(); @@ -53,7 +56,8 @@ class LikesTest extends TestCase $this->assertDatabaseHas('likes', ['url' => 'https://example.org/blog-post']); } - public function test_like_micropub_form_request() + /** @test */ + public function checkLikeCreatedFromMicropubWebRequests(): void { Queue::fake(); @@ -70,7 +74,8 @@ class LikesTest extends TestCase $this->assertDatabaseHas('likes', ['url' => 'https://example.org/blog-post']); } - public function test_process_like_job_with_simple_author() + /** @test */ + public function likeWithSimpleAuthor(): void { $like = new Like(); $like->url = 'http://example.org/note/id'; @@ -80,17 +85,18 @@ class LikesTest extends TestCase $job = new ProcessLike($like); $content = << - -
-
- A post that I like. -
- by Fred Bloggs -
- - -END; + + +
+
+ A post that I like. +
+ by Fred Bloggs +
+ + + END; + $mock = new MockHandler([ new Response(200, [], $content), new Response(200, [], $content), @@ -107,7 +113,8 @@ END; $this->assertEquals('Fred Bloggs', Like::find($id)->author_name); } - public function test_process_like_job_with_h_card() + /** @test */ + public function likeWithHCard(): void { $like = new Like(); $like->url = 'http://example.org/note/id'; @@ -117,21 +124,22 @@ END; $job = new ProcessLike($like); $content = << - -
-
- A post that I like. -
- by -
- Fred Bloggs - -
-
- - -END; + + +
+
+ A post that I like. +
+ by +
+ Fred Bloggs + +
+
+ + + END; + $mock = new MockHandler([ new Response(200, [], $content), new Response(200, [], $content), @@ -148,7 +156,8 @@ END; $this->assertEquals('Fred Bloggs', Like::find($id)->author_name); } - public function test_process_like_job_without_mf2() + /** @test */ + public function likeWithoutMicroformats(): void { $like = new Like(); $like->url = 'http://example.org/note/id'; @@ -158,14 +167,15 @@ END; $job = new ProcessLike($like); $content = << - -
- I liked a post -
- - -END; + + +
+ I liked a post +
+ + + END; + $mock = new MockHandler([ new Response(200, [], $content), new Response(200, [], $content), @@ -182,7 +192,8 @@ END; $this->assertNull(Like::find($id)->author_name); } - public function test_process_like_that_is_tweet() + /** @test */ + public function likeThatIsATweet(): void { $like = new Like(); $like->url = 'https://twitter.com/jonnybarnes/status/1050823255123251200'; @@ -202,10 +213,11 @@ END; return $client; }); - $info = new stdClass(); - $info->author_name = 'Jonny Barnes'; - $info->author_url = 'https://twitter.com/jonnybarnes'; - $info->html = '
HTML of the tweet embed
'; + $info = (object) [ + 'author_name' => 'Jonny Barnes', + 'author_url' => 'https://twitter.com/jonnybarnes', + 'html' => '
HTML of the tweet embed
', + ]; $codebirdMock = $this->getMockBuilder(Codebird::class) ->addMethods(['statuses_oembed']) ->getMock(); @@ -221,7 +233,7 @@ END; } /** @test */ - public function unknownLikeGives404() + public function unknownLikeGivesNotFoundResponse(): void { $response = $this->get('/likes/202'); $response->assertNotFound(); diff --git a/tests/Feature/MicropubControllerTest.php b/tests/Feature/MicropubControllerTest.php index 6a4941e8..5ac472e8 100644 --- a/tests/Feature/MicropubControllerTest.php +++ b/tests/Feature/MicropubControllerTest.php @@ -1,41 +1,33 @@ get('/api/post'); $response->assertStatus(401); $response->assertJsonFragment(['error_description' => 'No access token was provided in the request']); } - /** - * Test a GET request for the micropub endpoint without a valid token gives - * a 400 response. Also check the error message. - * - * @return void - */ - public function test_micropub_get_request_without_valid_token_returns_400_response() + /** @test */ + public function micropubGetRequestWithoutValidTokenReturnsErrorResponse(): void { $response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer abc123']); $response->assertStatus(400); @@ -44,80 +36,59 @@ class MicropubControllerTest extends TestCase /** * Test a GET request for the micropub endpoint with a valid token gives a - * 200 response. Check token information is returned in the response. + * 200 response. Check token information is also returned in the response. * - * @return void + * @test */ - public function test_micropub_get_request_with_valid_token_returns_200_response() + public function micropubGetRequestWithValidTokenReturnsOkResponse(): void { $response = $this->get('/api/post', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response->assertStatus(200); $response->assertJsonFragment(['response' => 'token']); } - /** - * Test a GET request for syndication targets. - * - * @return void - */ - public function test_micropub_get_request_for_syndication_targets() + /** @test */ + public function micropubClientsCanRequestSyndicationTargets(): void { $response = $this->get('/api/post?q=syndicate-to', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response->assertJsonFragment(['uid' => 'https://twitter.com/jonnybarnes']); } - /** - * Test a request for places. - * - * @return void - */ - public function test_micropub_get_request_for_nearby_places() - { - $response = $this->get('/api/post?q=geo:53.5,-2.38', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); - $response->assertJson(['places' => [['slug' =>'the-bridgewater-pub']]]); - } - - /** - * Test a request for places, this time with an uncertainty parameter. - * - * @return void - */ - public function test_micropub_get_request_for_nearby_places_with_uncertainty_parameter() + /** @test */ + public function micropubClientsCanRequestKnownNearbyPlaces(): void { $response = $this->get('/api/post?q=geo:53.5,-2.38', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response->assertJson(['places' => [['slug' => 'the-bridgewater-pub']]]); } /** - * Test a request for places, where there will be an “empty” response. - * - * @return void + * @test + * @todo Add uncertainty parameter */ - public function test_micropub_get_request_for_nearby_places_where_non_exist() + public function micropubClientsCanRequestKnownNearbyPlacesWithUncertaintyParameter(): void + { + $response = $this->get('/api/post?q=geo:53.5,-2.38', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); + $response->assertJson(['places' => [['slug' => 'the-bridgewater-pub']]]); + } + + /** @test */ + public function returnEmptyResultWhenMicropubClientRequestsKnownNearbyPlaces(): void { $response = $this->get('/api/post?q=geo:1.23,4.56', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response->assertJson(['places' => []]); } - /** - * Test a request for the micropub config. - * - * @return void - */ - public function test_micropub_get_request_for_config() + /** @test */ + public function micropubClientCanRequestEndpointConfig(): void { $response = $this->get('/api/post?q=config', ['HTTP_Authorization' => 'Bearer ' . $this->getToken()]); $response->assertJsonFragment(['uid' => 'https://twitter.com/jonnybarnes']); } - /** - * Test a valid micropub requests creates a new note. - * - * @return void - */ - public function test_micropub_post_request_creates_new_note() + /** @test */ + public function micropubClientCanCreateNewNote(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->post( '/api/post', @@ -133,15 +104,11 @@ class MicropubControllerTest extends TestCase $this->assertDatabaseHas('notes', ['note' => $note]); } - /** - * Test a valid micropub requests creates a new note and syndicates to Twitter. - * - * @return void - */ - public function test_micropub_post_request_creates_new_note_sends_to_twitter() + /** @test */ + public function micropubClientCanRequestTheNewNoteIsSyndicatedToTwitter(): void { Queue::fake(); - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->post( '/api/post', @@ -157,12 +124,8 @@ class MicropubControllerTest extends TestCase Queue::assertPushed(SyndicateNoteToTwitter::class); } - /** - * Test a valid micropub requests creates a new place. - * - * @return void - */ - public function test_micropub_post_request_creates_new_place() + /** @test */ + public function micropubClientsCanCreateNewPlaces(): void { $response = $this->post( '/api/post', @@ -177,13 +140,8 @@ class MicropubControllerTest extends TestCase $this->assertDatabaseHas('places', ['slug' => 'the-barton-arms']); } - /** - * Test a valid micropub requests creates a new place with latitude - * and longitude values defined separately. - * - * @return void - */ - public function test_micropub_post_request_creates_new_place_with_latlng() + /** @test */ + public function micropubClientsCanCreateNewPlacesWithOldLocationSyntax(): void { $response = $this->post( '/api/post', @@ -199,7 +157,8 @@ class MicropubControllerTest extends TestCase $this->assertDatabaseHas('places', ['slug' => 'the-barton-arms']); } - public function test_micropub_post_request_with_invalid_token_returns_expected_error_response() + /** @test */ + public function micropubClientWebRequestWithInvalidTokenReturnsErrorResponse(): void { $response = $this->post( '/api/post', @@ -213,7 +172,8 @@ class MicropubControllerTest extends TestCase $response->assertJson(['error' => 'invalid_token']); } - public function test_micropub_post_request_with_scopeless_token_returns_expected_error_response() + /** @test */ + public function micropubClientWebRequestWithTokenWithoutAnyScopesReturnsErrorResponse(): void { $response = $this->post( '/api/post', @@ -227,7 +187,8 @@ class MicropubControllerTest extends TestCase $response->assertJson(['error_description' => 'The provided token has no scopes']); } - public function test_micropub_post_request_for_place_without_create_scope_errors() + /** @test */ + public function micropubClientWebRequestWithTokenWithoutCreateScopesReturnsErrorResponse(): void { $response = $this->post( '/api/post', @@ -245,16 +206,16 @@ class MicropubControllerTest extends TestCase /** * Test a valid micropub requests using JSON syntax creates a new note. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_creates_new_note() + public function micropubClientApiRequestCreatesNewNote(): void { Queue::fake(); Media::create([ 'path' => 'test-photo.jpg', 'type' => 'image', ]); - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -282,16 +243,16 @@ class MicropubControllerTest extends TestCase * Test a valid micropub requests using JSON syntax creates a new note with * existing self-created place. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_creates_new_note_with_existing_place_in_location() + public function micropubClientApiRequestCreatesNewNoteWithExistingPlaceInLocationData(): void { $place = new Place(); $place->name = 'Test Place'; $place->latitude = 1.23; $place->longitude = 4.56; $place->save(); - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -313,11 +274,11 @@ class MicropubControllerTest extends TestCase * Test a valid micropub requests using JSON syntax creates a new note with * a new place defined in the location block. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_creates_new_note_with_new_place_in_location() + public function micropubClientApiRequestCreatesNewNoteWithNewPlaceInLocationData(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -349,11 +310,11 @@ class MicropubControllerTest extends TestCase * Test a valid micropub requests using JSON syntax creates a new note without * a new place defined in the location block if there is missing data. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_creates_new_note_without_new_place_in_location() + public function micropubClientApiRequestCreatesNewNoteWithoutNewPlaceInLocationData(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -383,11 +344,11 @@ class MicropubControllerTest extends TestCase * Test a micropub requests using JSON syntax without a token returns an * error. Also check the message. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_without_token_returns_error() + public function micropubClientApiRequestWithoutTokenReturnsError(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -410,11 +371,11 @@ class MicropubControllerTest extends TestCase * Test a micropub requests using JSON syntax without a valid token returns * an error. Also check the message. * - * @return void + * @test */ - public function test_micropub_post_request_with_json_syntax_with_insufficient_token_returns_error() + public function micropubClientApiRequestWithTokenWithInsufficientPermissionReturnsError(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->postJson( '/api/post', @@ -434,7 +395,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(401); } - public function test_micropub_post_request_with_json_syntax_for_unsupported_type_returns_error() + /** @test */ + public function micropubClientApiRequestForUnsupportedPostTypeReturnsError(): void { $response = $this->postJson( '/api/post', @@ -454,9 +416,10 @@ class MicropubControllerTest extends TestCase ->assertStatus(500); } - public function test_micropub_post_request_with_json_syntax_creates_new_place() + /** @test */ + public function micropubClientApiRequestCreatesNewPlace(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $response = $this->postJson( '/api/post', [ @@ -473,9 +436,10 @@ class MicropubControllerTest extends TestCase ->assertStatus(201); } - public function test_micropub_post_request_with_json_syntax_and_uncertainty_parameter_creates_new_place() + /** @test */ + public function micropubClientApiRequestCreatesNewPlaceWithUncertaintyParameter(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $response = $this->postJson( '/api/post', [ @@ -492,7 +456,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(201); } - public function test_micropub_post_request_with_json_syntax_update_replace_post() + /** @test */ + public function micropubClientApiRequestUpdatesExistingNote(): void { $response = $this->postJson( '/api/post', @@ -510,7 +475,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(200); } - public function test_micropub_post_request_with_json_syntax_update_add_post() + /** @test */ + public function micropubClientApiRequestUpdatesNoteSyndicationLinks(): void { $response = $this->postJson( '/api/post', @@ -535,7 +501,8 @@ class MicropubControllerTest extends TestCase ]); } - public function test_micropub_post_request_with_json_syntax_update_add_image_to_post() + /** @test */ + public function micropubClientApiRequestAddsImageToNote(): void { $response = $this->postJson( '/api/post', @@ -556,7 +523,8 @@ class MicropubControllerTest extends TestCase ]); } - public function test_micropub_post_request_with_json_syntax_update_add_post_errors_for_non_note() + /** @test */ + public function micropubClientApiRequestReturnsErrorTryingToUpdateNonNoteModel(): void { $response = $this->postJson( '/api/post', @@ -574,7 +542,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(500); } - public function test_micropub_post_request_with_json_syntax_update_add_post_errors_for_note_not_found() + /** @test */ + public function micropubClientApiRequestReturnsErrorTryingToUpdateNonExistingNote(): void { $response = $this->postJson( '/api/post', @@ -592,7 +561,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(404); } - public function test_micropub_post_request_with_json_syntax_update_add_post_errors_for_unsupported_request() + /** @test */ + public function micropubClientApiRequestReturnsErrorWhenTryingToUpdateUnsupportedProperty(): void { $response = $this->postJson( '/api/post', @@ -610,7 +580,8 @@ class MicropubControllerTest extends TestCase ->assertStatus(500); } - public function test_micropub_post_request_with_json_syntax_update_errors_for_insufficient_scope() + /** @test */ + public function micropubClientApiRequestWithTokenWithInsufficientScopeReturnsError(): void { $response = $this->postJson( '/api/post', @@ -628,7 +599,8 @@ class MicropubControllerTest extends TestCase ->assertJson(['error' => 'insufficient_scope']); } - public function test_micropub_post_request_with_json_syntax_update_replace_post_syndication() + /** @test */ + public function micropubClientApiRequestCanReplaceNoteSyndicationTargets(): void { $response = $this->postJson( '/api/post', @@ -653,9 +625,10 @@ class MicropubControllerTest extends TestCase ]); } - public function test_access_token_form_encoded() + /** @test */ + public function micropubClientWebReauestCanEncodeTokenWithinTheForm(): void { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $note = $faker->text; $response = $this->post( '/api/post', diff --git a/tests/Feature/MicropubMediaTest.php b/tests/Feature/MicropubMediaTest.php index 5b507d94..50be6114 100644 --- a/tests/Feature/MicropubMediaTest.php +++ b/tests/Feature/MicropubMediaTest.php @@ -1,5 +1,7 @@ each(function ($media) { @@ -33,7 +35,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function clientCanListLastUpload() + public function clientCanListLastUpload(): void { Queue::fake(); Storage::fake('s3'); @@ -61,7 +63,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function clientCanSourceUploads() + public function clientCanSourceUploads(): void { Queue::fake(); Storage::fake('s3'); @@ -91,7 +93,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function clientCanSourceUploadsWithLimit() + public function clientCanSourceUploadsWithLimit(): void { Queue::fake(); Storage::fake('s3'); @@ -123,7 +125,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function errorResponseForUnknownQValue() + public function errorResponseForUnknownQValue(): void { $response = $this->get( '/api/media?q=unknown', @@ -134,7 +136,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function optionsRequestReturnsCorsResponse() + public function optionsRequestReturnsCorsResponse(): void { $response = $this->options('/api/media'); @@ -143,7 +145,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointRequestWithInvalidTokenReturns400Response() + public function mediaEndpointRequestWithInvalidTokenReturns400Response(): void { $response = $this->post( '/api/media', @@ -155,7 +157,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointRequestWithTokenWithNoScopeReturns400Response() + public function mediaEndpointRequestWithTokenWithNoScopeReturns400Response(): void { $response = $this->post( '/api/media', @@ -167,7 +169,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointRequestWithInsufficientTokenScopesReturns401Response() + public function mediaEndpointRequestWithInsufficientTokenScopesReturns401Response(): void { $response = $this->post( '/api/media', @@ -181,7 +183,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointUploadFile() + public function mediaEndpointUploadFile(): void { Queue::fake(); Storage::fake('s3'); @@ -204,7 +206,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointUploadAudioFile() + public function mediaEndpointUploadAudioFile(): void { Queue::fake(); Storage::fake('s3'); @@ -227,7 +229,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointUploadVideoFile() + public function mediaEndpointUploadVideoFile(): void { Queue::fake(); Storage::fake('s3'); @@ -250,7 +252,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointUploadDocumentFile() + public function mediaEndpointUploadDocumentFile(): void { Queue::fake(); Storage::fake('s3'); @@ -272,7 +274,7 @@ class MicropubMediaTest extends TestCase } /** @test */ - public function mediaEndpointUploadInvalidFileReturnsError() + public function mediaEndpointUploadInvalidFileReturnsError(): void { Queue::fake(); Storage::fake('local'); diff --git a/tests/Feature/NotesControllerTest.php b/tests/Feature/NotesControllerTest.php index bf3bd79a..59197e4a 100644 --- a/tests/Feature/NotesControllerTest.php +++ b/tests/Feature/NotesControllerTest.php @@ -1,47 +1,49 @@ get('/notes'); $response->assertStatus(200); - } + }*/ /** * Test a specific note. * - * @return void + * @test */ - public function test_specific_note() + public function specificNotePageLoads(): void { $response = $this->get('/notes/D'); $response->assertViewHas('note'); } - public function test_note_replying_to_tweet() + /* @test * + public function noteReplyingToTweet(): void { $response = $this->get('/notes/B'); $response->assertViewHas('note'); - } + }*/ /** * Test that `/note/{decID}` redirects to `/notes/{nb60id}`. * - * @return void + * @test */ - public function test_dec_id_redirect() + public function oldNoteUrlsRedirect(): void { $response = $this->get('/note/11'); $response->assertRedirect(config('app.url') . '/notes/B'); @@ -50,9 +52,9 @@ class NotesControllerTest extends TestCase /** * Visit the tagged page and check the tag view data. * - * @return void + * @test */ - public function test_tagged_notes_page() + public function taggedNotesPageLoads(): void { $response = $this->get('/notes/tagged/beer'); $response->assertViewHas('tag', 'beer'); diff --git a/tests/Feature/OwnYourGramTest.php b/tests/Feature/OwnYourGramTest.php index e071b511..bbed744f 100644 --- a/tests/Feature/OwnYourGramTest.php +++ b/tests/Feature/OwnYourGramTest.php @@ -1,18 +1,21 @@ json( 'POST', @@ -21,10 +24,13 @@ class OwnYourGramTest extends TestCase 'type' => ['h-entry'], 'properties' => [ 'content' => ['How beautiful are the plates and chopsticks'], - 'published' => [\Carbon\Carbon::now()->toIso8601String()], + 'published' => [Carbon::now()->toIso8601String()], 'location' => ['geo:53.802419075834,-1.5431942917637'], 'syndication' => ['https://www.instagram.com/p/BVC_nVTBFfi/'], - 'photo' => ['https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg'], + 'photo' => [ + // phpcs:ignore Generic.Files.LineLength.TooLong + 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg' + ], ], ], ['HTTP_Authorization' => 'Bearer ' . $this->getToken()] @@ -34,6 +40,7 @@ class OwnYourGramTest extends TestCase 'response' => 'created' ]); $this->assertDatabaseHas('media_endpoint', [ + // phpcs:ignore Generic.Files.LineLength.TooLong 'path' => 'https://scontent-sjc2-1.cdninstagram.com/t51.2885-15/e35/18888604_425332491185600_326487281944756224_n.jpg' ]); $this->assertDatabaseHas('notes', [ diff --git a/tests/Feature/ParseCachedWebMentionsTest.php b/tests/Feature/ParseCachedWebMentionsTest.php index f07bf247..da192d64 100644 --- a/tests/Feature/ParseCachedWebMentionsTest.php +++ b/tests/Feature/ParseCachedWebMentionsTest.php @@ -1,12 +1,14 @@ assertFileExists(storage_path('HTML') . '/https/aaronpk.localhost/reply/1'); $this->assertFileExists(storage_path('HTML') . '/http/tantek.com/index.html'); diff --git a/tests/Feature/PlacesTest.php b/tests/Feature/PlacesTest.php index 0940d40e..56c4ebbd 100644 --- a/tests/Feature/PlacesTest.php +++ b/tests/Feature/PlacesTest.php @@ -1,18 +1,20 @@ get('/places'); $response->assertStatus(200); @@ -21,9 +23,9 @@ class PlacesTest extends TestCase /** * Test a specific place. * - * @return void + * @test */ - public function test_single_place() + public function singlePlacePageLoads(): void { $place = Place::where('slug', 'the-bridgewater-pub')->first(); $response = $this->get('/places/the-bridgewater-pub'); diff --git a/tests/Feature/ReDownloadWebMentionsTest.php b/tests/Feature/ReDownloadWebMentionsTest.php index 60e4c2c1..174cd6d5 100644 --- a/tests/Feature/ReDownloadWebMentionsTest.php +++ b/tests/Feature/ReDownloadWebMentionsTest.php @@ -1,15 +1,18 @@ get('/search?terms=love'); $response->assertSee('duckduckgo.com'); diff --git a/tests/Feature/ShortURLsControllerTest.php b/tests/Feature/ShortURLsControllerTest.php index dfa9b670..0fbfff65 100644 --- a/tests/Feature/ShortURLsControllerTest.php +++ b/tests/Feature/ShortURLsControllerTest.php @@ -1,33 +1,38 @@ get('http://' . config('app.shorturl')); + $response = $this->get('https://' . config('app.shorturl')); $response->assertRedirect(config('app.url')); } - public function test_short_domain_slashat_redirects_to_twitter() + /** @test */ + public function shortDomainSlashAtRedirectsToTwitter(): void { - $response = $this->get('http://' . config('app.shorturl') . '/@'); + $response = $this->get('https://' . config('app.shorturl') . '/@'); $response->assertRedirect('https://twitter.com/jonnybarnes'); } - public function test_short_domain_slasht_redirects_to_long_domain_slash_notes() + /** @test */ + public function shortDomainSlashTRedirectsToLongDomainSlashNotes(): void { - $response = $this->get('http://' . config('app.shorturl') . '/t/E'); + $response = $this->get('https://' . config('app.shorturl') . '/t/E'); $response->assertRedirect(config('app.url') . '/notes/E'); } - public function test_short_domain_slashb_redirects_to_long_domain_slash_blog() + /** @test */ + public function shortDomainSlashBRedirectsToLongDomainSlashBlog(): void { - $response = $this->get('http://' . config('app.shorturl') . '/b/1'); + $response = $this->get('https://' . config('app.shorturl') . '/b/1'); $response->assertRedirect(config('app.url') . '/blog/s/1'); } } diff --git a/tests/Feature/SwarmTest.php b/tests/Feature/SwarmTest.php index e2b9ce55..aaec89d8 100644 --- a/tests/Feature/SwarmTest.php +++ b/tests/Feature/SwarmTest.php @@ -1,26 +1,37 @@ json( 'POST', 'api/post', [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'syndication' => ['https://www.swarmapp.com/checkin/abc'], 'content' => [[ 'value' => 'My first #checkin using Example Product', @@ -48,18 +59,27 @@ class SwarmTest extends TestCase $this->assertDatabaseHas('places', [ 'external_urls' => '{"foursquare": "https://foursquare.com/v/123456"}' ]); + + Queue::assertPushed(SendWebMentions::class); } - // this request would actually come from another client than OwnYourSwarm - public function test_faked_ownyourswarm_request_with_osm() + /** + * This request would actually come from another client than OwnYourSwarm, but we’re testing + * OpenStreetMap data. + * + * @test + */ + public function mockedOwnyourswarmRequestWithOsm(): void { + Queue::fake(); + $response = $this->json( 'POST', 'api/post', [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'content' => [[ 'value' => 'My first #checkin using Example Product', 'html' => 'My first #checkin using Example Product', @@ -83,18 +103,26 @@ class SwarmTest extends TestCase $this->assertDatabaseHas('places', [ 'external_urls' => '{"osm": "https://www.openstreetmap.org/way/123456"}' ]); + + Queue::assertPushed(SendWebMentions::class); } - // this request would actually come from another client than OwnYourSwarm - public function test_faked_ownyourswarm_request_without_known_external_url() + /** + * This request would actually come from another client than OwnYourSwarm, as that would include a Foursquare URL + * + * @test + */ + public function mockedOwnyourswarmRequestWithoutKnownExternalUrl(): void { + Queue::fake(); + $response = $this->json( 'POST', 'api/post', [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'content' => [[ 'value' => 'My first #checkin using Example Product', 'html' => 'My first #checkin using Example Product', @@ -118,9 +146,12 @@ class SwarmTest extends TestCase $this->assertDatabaseHas('places', [ 'external_urls' => '{"default": "https://www.example.org/way/123456"}' ]); + + Queue::assertPushed(SendWebMentions::class); } - public function test_faked_ownyourswarm_request_with_no_text_content() + /** @test */ + public function mockedOwnyourswarmRequestWithNoTextContent(): void { $response = $this->json( 'POST', @@ -128,7 +159,7 @@ class SwarmTest extends TestCase [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'syndication' => ['https://www.swarmapp.com/checkin/def'], ], 'checkin' => [ @@ -152,18 +183,22 @@ class SwarmTest extends TestCase $this->assertDatabaseHas('notes', [ 'swarm_url' => 'https://www.swarmapp.com/checkin/def' ]); + // Check the default text content for the note was saved $this->get($response->__get('headers')->get('location'))->assertSee('📍'); } - public function test_faked_ownyourswarm_request_saves_just_post_when_error_in_checkin_data() + /** @test */ + public function mockedOwnyourswarmRequestSavesJustThePostWhenAnErrorOccursInTheCheckinData(): void { + Queue::fake(); + $response = $this->json( 'POST', 'api/post', [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'syndication' => ['https://www.swarmapp.com/checkin/abc'], 'content' => [[ 'value' => 'My first #checkin using Example Product', @@ -186,17 +221,22 @@ class SwarmTest extends TestCase $this->assertDatabaseMissing('places', [ 'name' => 'Awesome Venue', ]); + + Queue::assertPushed(SendWebMentions::class); } - public function test_ownyourswarm_request_with_hadr_location() + /** @test */ + public function mockedOwnyourswarmRequestWithHAdrLocation(): void { + Queue::fake(); + $response = $this->json( 'POST', 'api/post', [ 'type' => ['h-entry'], 'properties' => [ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()], + 'published' => [Carbon::now()->toDateTimeString()], 'syndication' => ['https://www.swarmapp.com/checkin/abc'], 'content' => [[ 'value' => 'My first #checkin using Example Product', @@ -227,18 +267,20 @@ class SwarmTest extends TestCase $this->assertDatabaseMissing('places', [ 'name' => 'Awesome Venue', ]); + + Queue::assertPushed(SendWebMentions::class); } /** @test */ - public function a_real_ownyourswarm_checkin() + public function ownyourswarmCheckinTestUsingRealData(): void { $response = $this->json( 'POST', 'api/post', [ 'type' => ['h-entry'], - 'properties' =>[ - 'published' => [\Carbon\Carbon::now()->toDateTimeString()] + 'properties' => [ + 'published' => [Carbon::now()->toDateTimeString()] ], 'syndication' => [ 'https://www.swarmapp.com/user/199841/checkin/5c4b1ac56dcf04002c0a4f58' diff --git a/tests/Feature/TokenEndpointTest.php b/tests/Feature/TokenEndpointTest.php index 19b2b49f..de798a40 100644 --- a/tests/Feature/TokenEndpointTest.php +++ b/tests/Feature/TokenEndpointTest.php @@ -1,15 +1,17 @@ shouldReceive('discoverAuthorizationEndpoint') @@ -35,7 +37,8 @@ class TokenEndpointTest extends TestCase ]); } - public function test_token_endpoint_returns_error_when_auth_endpoint_lacks_me_data() + /** @test */ + public function tokenEndpointReturnsErrorWhenAuthEndpointLacksMeData(): void { $mockClient = Mockery::mock(Client::class); $mockClient->shouldReceive('discoverAuthorizationEndpoint') @@ -60,7 +63,8 @@ class TokenEndpointTest extends TestCase ]); } - public function test_token_endpoint_returns_error_when_no_auth_endpoint_found() + /** @test */ + public function tokenEndpointReturnsErrorWhenNoAuthEndpointFound(): void { $mockClient = Mockery::mock(Client::class); $mockClient->shouldReceive('discoverAuthorizationEndpoint') diff --git a/tests/Feature/TokenServiceTest.php b/tests/Feature/TokenServiceTest.php index 90c878ce..131d2b9d 100644 --- a/tests/Feature/TokenServiceTest.php +++ b/tests/Feature/TokenServiceTest.php @@ -1,13 +1,15 @@ assertSame($data, $validData); } - public function test_token_with_different_signing_key_throws_exception() + /** @test */ + public function tokensWithDifferentSigningKeyThrowsException(): void { $this->expectException(RequiredConstraintsViolated::class); diff --git a/tests/Feature/WebMentionsControllerTest.php b/tests/Feature/WebMentionsControllerTest.php index bf7edfae..c3917d3e 100644 --- a/tests/Feature/WebMentionsControllerTest.php +++ b/tests/Feature/WebMentionsControllerTest.php @@ -1,14 +1,17 @@ get('/webmention'); $response->assertViewIs('webmention-endpoint'); @@ -17,20 +20,22 @@ class WebMentionsControllerTest extends TestCase /** * Test webmentions without source and target are rejected. * - * @return void + * @test */ - public function test_webmentions_without_source_and_target_are_rejected() + public function webmentionsWithoutSourceAndTargetAreRejected(): void { $response = $this->call('POST', '/webmention', ['source' => 'https://example.org/post/123']); $response->assertStatus(400); } /** - * Test invalid target gets a 400 response. + * Test invalid target gives a 400 response. * - * @return void + * In this case an invalid target is a URL that doesn’t exist on our domain. + * + * @test */ - public function test_invalid_target_returns_400_response() + public function invalidTargetReturnsErrorResponse(): void { $response = $this->call('POST', '/webmention', [ 'source' => 'https://example.org/post/123', @@ -40,11 +45,11 @@ class WebMentionsControllerTest extends TestCase } /** - * Test blog target gets a 501 response due to me not supporting it. + * Test blog target gets a 501 response due to our not supporting it. * - * @return void + * @test */ - public function test_blog_target_returns_501_response() + public function blogTargetReturns501Response(): void { $response = $this->call('POST', '/webmention', [ 'source' => 'https://example.org/post/123', @@ -54,11 +59,11 @@ class WebMentionsControllerTest extends TestCase } /** - * Test that a non-existant note gives a 400 response. + * Test that a non-existent note gives a 400 response. * - * @return void + * @test */ - public function test_nonexistant_note_returns_400_response() + public function nonexistentNoteReturnsErrorResponse(): void { $response = $this->call('POST', '/webmention', [ 'source' => 'https://example.org/post/123', @@ -67,12 +72,8 @@ class WebMentionsControllerTest extends TestCase $response->assertStatus(400); } - /** - * Test a legit webmention triggers the ProcessWebMention job. - * - * @return void - */ - public function test_legitimate_webmnetion_triggers_processwebmention_job() + /** @test */ + public function legitimateWebmentionTriggersProcesswebmentionJob(): void { Queue::fake(); diff --git a/tests/Unit/ArticlesTest.php b/tests/Unit/ArticlesTest.php index 8a38531e..d16f640c 100644 --- a/tests/Unit/ArticlesTest.php +++ b/tests/Unit/ArticlesTest.php @@ -1,16 +1,19 @@ title = 'My Title'; @@ -20,15 +23,17 @@ class ArticlesTest extends TestCase $this->assertEquals('my-title', $article->titleurl); } - public function test_markdown_conversion() + /** @test */ + public function markdownContentIsConverted(): void { $article = new Article(); $article->main = 'Some *markdown*'; - $this->assertEquals('

Some markdown

'.PHP_EOL, $article->html); + $this->assertEquals('

Some markdown

' . PHP_EOL, $article->html); } - public function test_time_attributes() + /** @test */ + public function weGenerateTheDifferentTimeAttributes(): void { $article = Article::create([ 'title' => 'Test', @@ -41,7 +46,8 @@ class ArticlesTest extends TestCase $this->assertEquals($article->pubdate, $article->updated_at->toRSSString()); } - public function test_link_accessor() + /** @test */ + public function weGenerateTheArticleLinkFromTheSlug(): void { $article = Article::create([ 'title' => 'Test', @@ -55,7 +61,8 @@ class ArticlesTest extends TestCase ); } - public function test_date_scope() + /** @test */ + public function dateScopeReturnsExpectedArticles(): void { $yearAndMonth = Article::date(date('Y'), date('m'))->get(); $this->assertTrue(count($yearAndMonth) === 1); diff --git a/tests/Unit/BookmarksTest.php b/tests/Unit/BookmarksTest.php index c5691795..db8fc4ce 100644 --- a/tests/Unit/BookmarksTest.php +++ b/tests/Unit/BookmarksTest.php @@ -1,27 +1,31 @@ saveScreenshot('https://www.google.co.uk'); + $uuid = (new BookmarkService())->saveScreenshot('https://duckduckgo.com'); $this->assertTrue(file_exists(public_path() . '/assets/img/bookmarks/' . $uuid . '.png')); - } + }*/ - public function test_archive_link_method() + /** @test */ + public function archiveLinkMethodCallsArchiveService(): void { $mock = new MockHandler([ new Response(200, ['Content-Location' => '/web/1234/example.org']), @@ -33,7 +37,8 @@ class BookmarksTest extends TestCase $this->assertEquals('/web/1234/example.org', $url); } - public function test_archive_link_method_archive_site_error_exception() + /** @test */ + public function archiveLinkMethodThrowsAnExceptionOnError(): void { $this->expectException(InternetArchiveException::class); @@ -43,10 +48,11 @@ class BookmarksTest extends TestCase $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->app->instance(Client::class, $client); - $url = (new BookmarkService())->getArchiveLink('https://example.org'); + (new BookmarkService())->getArchiveLink('https://example.org'); } - public function test_archive_link_method_archive_site_no_location_exception() + /** @test */ + public function archiveLinkMethodThrowsAnExceptionIfNoLocationReturned(): void { $this->expectException(InternetArchiveException::class); @@ -56,6 +62,6 @@ class BookmarksTest extends TestCase $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $this->app->instance(Client::class, $client); - $url = (new BookmarkService())->getArchiveLink('https://example.org'); + (new BookmarkService())->getArchiveLink('https://example.org'); } } diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php index a9b32150..f173ff09 100644 --- a/tests/Unit/HelpersTest.php +++ b/tests/Unit/HelpersTest.php @@ -1,18 +1,72 @@ assertEquals(normalize_url(normalize_url($input)), normalize_url($input)); } - public function urlProvider() + /** + * @test + * @dataProvider urlProvider + * @param string $input + * @param string $output + */ + public function normalizeUrlOnDataProvider(string $input, string $output): void + { + $this->assertEquals($output, normalize_url($input)); + } + + /** @test */ + public function prettyPrintJson(): void + { + // phpcs:disable Generic.Files.LineLength.TooLong + $json = <<assertEquals($expected, prettyPrintJson($json)); + } + + public function urlProvider(): array { return [ ['https://example.org/', 'https://example.org'], @@ -25,48 +79,4 @@ class HelpersTest extends TestCase ], ]; } - - /** - * @dataProvider urlProvider - * @group temp - */ - public function test_normalize_url($input, $output) - { - $this->assertEquals($output, normalize_url($input)); - } - - public function test_pretty_print_json() - { - $json = <<assertEquals($expected, prettyPrintJson($json)); - } } diff --git a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php index 75d203c6..d2f12d87 100644 --- a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php +++ b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php @@ -1,16 +1,19 @@ handle(); diff --git a/tests/Unit/Jobs/DownloadWebMentionJobTest.php b/tests/Unit/Jobs/DownloadWebMentionJobTest.php index 4ca1efa8..c537e77a 100644 --- a/tests/Unit/Jobs/DownloadWebMentionJobTest.php +++ b/tests/Unit/Jobs/DownloadWebMentionJobTest.php @@ -1,14 +1,16 @@ assertFileDoesNotExist(storage_path('HTML/https')); $source = 'https://example.org/reply/1'; $html = << - - -HTML; +
+ +
+ HTML; $html = str_replace('href=""', 'href="' . config('app.url') . '/notes/A"', $html); $mock = new MockHandler([ new Response(200, ['X-Foo' => 'Bar'], $html), @@ -48,21 +51,22 @@ HTML; $this->assertFileDoesNotExist(storage_path('HTML/https/example.org/reply') . '/1.' . date('Y-m-d') . '.backup'); } - public function test_the_job_saves_html_and_backup() + /** @test */ + public function htmlAndBackupSavedByJob(): void { $this->assertFileDoesNotExist(storage_path('HTML/https')); $source = 'https://example.org/reply/1'; $html = << - - -HTML; +
+ +
+ HTML; $html2 = << - - - -HTML; +
+ + +
+ HTML; $html = str_replace('href=""', 'href="' . config('app.url') . '/notes/A"', $html); $html2 = str_replace('href=""', 'href="' . config('app.url') . '/notes/A"', $html2); $mock = new MockHandler([ @@ -82,15 +86,16 @@ HTML; $this->assertFileExists(storage_path('HTML/https/example.org/reply') . '/1.' . date('Y-m-d') . '.backup'); } - public function test_an_index_html_file() + /** @test */ + public function indexHtmlFileIsSavedByJobForUrlsEndingWithSlash(): void { $this->assertFileDoesNotExist(storage_path('HTML/https')); $source = 'https://example.org/reply-one/'; $html = << - - -HTML; +
+ +
+ HTML; $html = str_replace('href=""', 'href="' . config('app.url') . '/notes/A"', $html); $mock = new MockHandler([ new Response(200, ['X-Foo' => 'Bar'], $html), diff --git a/tests/Unit/Jobs/ProcessBookmarkJobTest.php b/tests/Unit/Jobs/ProcessBookmarkJobTest.php index 99204c9e..fea471f1 100644 --- a/tests/Unit/Jobs/ProcessBookmarkJobTest.php +++ b/tests/Unit/Jobs/ProcessBookmarkJobTest.php @@ -1,24 +1,23 @@ method('saveScreenshot') ->willReturn($uuid->toString()); $service->method('getArchiveLink') - ->will($this->throwException(new InternetArchiveException)); + ->will($this->throwException(new InternetArchiveException())); $this->app->instance(BookmarkService::class, $service); $job = new ProcessBookmark($bookmark); diff --git a/tests/Unit/Jobs/ProcessMediaJobTest.php b/tests/Unit/Jobs/ProcessMediaJobTest.php index ffde5cc8..64d7396f 100644 --- a/tests/Unit/Jobs/ProcessMediaJobTest.php +++ b/tests/Unit/Jobs/ProcessMediaJobTest.php @@ -1,15 +1,18 @@ make(ImageManager::class); @@ -20,18 +23,20 @@ class ProcessMediaJobTest extends TestCase $this->assertFalse(file_exists(storage_path('app') . '/file.txt')); } - public function test_job_does_nothing_to_small_images() + /** @test */ + public function smallImagesAreNotResized(): void { Storage::fake('s3'); $manager = app()->make(ImageManager::class); - Storage::disk('local')->put('aaron.png', file_get_contents(__DIR__.'/../../aaron.png')); + Storage::disk('local')->put('aaron.png', file_get_contents(__DIR__ . '/../../aaron.png')); $job = new ProcessMedia('aaron.png'); $job->handle($manager); $this->assertFalse(file_exists(storage_path('app') . '/aaron.png')); } - public function test_large_images_have_smaller_files_created() + /** @test */ + public function largeImagesHaveSmallerImagesCreated(): void { $manager = app()->make(ImageManager::class); Storage::disk('local')->put('test-image.jpg', file_get_contents(__DIR__.'/../../test-image.jpg')); diff --git a/tests/Unit/Jobs/ProcessWebMentionJobTest.php b/tests/Unit/Jobs/ProcessWebMentionJobTest.php index bede514c..e8734fbb 100644 --- a/tests/Unit/Jobs/ProcessWebMentionJobTest.php +++ b/tests/Unit/Jobs/ProcessWebMentionJobTest.php @@ -1,21 +1,23 @@ expectException(RemoteContentNotFoundException::class); @@ -48,17 +51,18 @@ class ProcessWebMentionJobTest extends TestCase $job->handle($parser, $client); } - public function test_a_new_webmention_gets_saved() + /** @test */ + public function newWebmentionGetsSavedByJob(): void { Queue::fake(); $parser = new Parser(); $html = << - I liked a note. - -HTML; +
+ I liked a note. +
+ HTML; $html = str_replace('href="', 'href="' . config('app.url'), $html); $mock = new MockHandler([ new Response(200, [], $html), @@ -79,18 +83,19 @@ HTML; ]); } - public function test_existing_webmention_gets_updated() + /** @test */ + public function existingWebmentionGetsUpdatedByJob(): void { Queue::fake(); $parser = new Parser(); $html = << -

In reply to a note

-
Updated reply
- -HTML; +
+

In reply to a note

+
Updated reply
+
+ HTML; $html = str_replace('href="', 'href="' . config('app.url'), $html); $mock = new MockHandler([ new Response(200, [], $html), @@ -108,20 +113,22 @@ HTML; $this->assertDatabaseHas('webmentions', [ 'source' => $source, 'type' => 'in-reply-to', + // phpcs:ignore Generic.Files.LineLength.TooLong 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"content": [{"html": "Updated reply", "value": "Updated reply"}], "in-reply-to": ["' . config('app.url') . '/notes/E"]}}], "rel-urls": []}', ]); } - public function test_webmention_reply_gets_deleted() + /** @test */ + public function webmentionReplyGetsDeletedWhenReplyToValueChanges(): void { $parser = new Parser(); $html = << -

In reply to a note

-
Replying to someone else
- -HTML; +
+

In reply to a note

+
Replying to someone else
+
+ HTML; $mock = new MockHandler([ new Response(200, [], $html), ]); @@ -148,16 +155,17 @@ HTML; ]); } - public function test_webmention_like_gets_deleted() + /** @test */ + public function webmentionLikeGetsDeletedWhenLikeOfValueChanges(): void { $parser = new Parser(); $html = << -

In reply to a note

-
I like someone else now
- -HTML; +
+

In reply to a note

+
I like someone else now
+
+ HTML; $mock = new MockHandler([ new Response(200, [], $html), ]); @@ -184,16 +192,17 @@ HTML; ]); } - public function test_webmention_repost_gets_deleted() + /** @test */ + public function webmentionRepostGetsDeletedWhenRepostOfValueChanges(): void { $parser = new Parser(); $html = << -

In reply to a note

-
Reposting someone else
- -HTML; +
+

In reply to a note

+
Reposting someone else
+
+ HTML; $mock = new MockHandler([ new Response(200, [], $html), ]); diff --git a/tests/Unit/Jobs/SaveProfileImageJobTest.php b/tests/Unit/Jobs/SaveProfileImageJobTest.php index e278798b..1ecc5807 100644 --- a/tests/Unit/Jobs/SaveProfileImageJobTest.php +++ b/tests/Unit/Jobs/SaveProfileImageJobTest.php @@ -1,16 +1,17 @@ []]; $authorship = $this->createMock(Authorship::class); $authorship->method('findAuthor') - ->will($this->throwException(new AuthorshipParserException)); + ->will($this->throwException(new AuthorshipParserException())); $job = new SaveProfileImage($mf); $this->assertNull($job->handle($authorship)); } - public function test_we_dont_process_twitter_images() + /** @test */ + public function weDoNotProcessTwitterImages(): void { $mf = ['items' => []]; $author = [ @@ -50,7 +54,8 @@ class SaveProfileImageJobTest extends TestCase $this->assertNull($job->handle($authorship)); } - public function test_saving_of_remote_image() + /** @test */ + public function remoteAuthorImagesAreSavedLocally(): void { $mock = new MockHandler([ new Response(200, ['Content-Type' => 'image/jpeg'], 'fake jpeg image'), @@ -74,7 +79,8 @@ class SaveProfileImageJobTest extends TestCase $this->assertFileExists(public_path() . '/assets/profile-images/example.org/image'); } - public function test_copying_of_local_image() + /** @test */ + public function localDefaultAuthorImageIsUsedAsFallback(): void { $mock = new MockHandler([ new Response(404), diff --git a/tests/Unit/Jobs/SendWebMentionJobTest.php b/tests/Unit/Jobs/SendWebMentionJobTest.php index ac80a6fb..213ad200 100644 --- a/tests/Unit/Jobs/SendWebMentionJobTest.php +++ b/tests/Unit/Jobs/SendWebMentionJobTest.php @@ -1,19 +1,21 @@ assertNull($job->discoverWebmentionEndpoint('/notes/tagged/test')); } - public function test_discover_endpoint_gets_link_from_headers() + /** @test */ + public function discoverWebmentionEndpointFromHeaderLinks(): void { $url = 'https://example.org/webmention'; $mock = new MockHandler([ @@ -35,7 +38,8 @@ class SendWebMentionJobTest extends TestCase $this->assertEquals($url, $job->discoverWebmentionEndpoint('https://example.org')); } - public function test_discover_endpoint_correctly_parses_html() + /** @test */ + public function discoverWebmentionEndpointFromHtmlLinkTags(): void { $html = ''; $mock = new MockHandler([ @@ -52,7 +56,8 @@ class SendWebMentionJobTest extends TestCase ); } - public function test_discover_endpoint_correctly_parses_html_legacy() + /** @test */ + public function discoverWebmentionEndpointFromLegacyHtmlMarkup(): void { $html = ''; $mock = new MockHandler([ @@ -69,13 +74,15 @@ class SendWebMentionJobTest extends TestCase ); } - public function test_empty_note_does_nothing() + /** @test */ + public function ensureEmptyNoteDoesNotTriggerAnyActions(): void { $job = new SendWebMentions(new Note()); $this->assertNull($job->handle()); } - public function test_resolve_uri() + /** @test */ + public function weResolveRelativeUris(): void { $uri = '/blog/post'; $base = 'https://example.org/'; @@ -83,7 +90,8 @@ class SendWebMentionJobTest extends TestCase $this->assertEquals('https://example.org/blog/post', $job->resolveUri($uri, $base)); } - public function test_the_job() + /** @test */ + public function weSendAWebmentionForANote(): void { $html = ''; $mock = new MockHandler([ @@ -98,6 +106,7 @@ class SendWebMentionJobTest extends TestCase $note->note = 'Hi [Aaron](https://aaronparecki.com)'; $note->save(); $job = new SendWebMentions($note); - $this->assertNull($job->handle()); + $job->handle(); + $this->assertTrue(true); } } diff --git a/tests/Unit/Jobs/SyndicateBookmarkToTwitterJobTest.php b/tests/Unit/Jobs/SyndicateBookmarkToTwitterJobTest.php index 005a1d1b..9f6c19da 100644 --- a/tests/Unit/Jobs/SyndicateBookmarkToTwitterJobTest.php +++ b/tests/Unit/Jobs/SyndicateBookmarkToTwitterJobTest.php @@ -1,21 +1,24 @@ 'https://twitter.com/123' diff --git a/tests/Unit/Jobs/SyndicateNoteToTwitterJobTest.php b/tests/Unit/Jobs/SyndicateNoteToTwitterJobTest.php index 039384f2..20e2490e 100644 --- a/tests/Unit/Jobs/SyndicateNoteToTwitterJobTest.php +++ b/tests/Unit/Jobs/SyndicateNoteToTwitterJobTest.php @@ -2,20 +2,21 @@ namespace Tests\Unit\Jobs; -use Tests\TestCase; +use App\Jobs\SyndicateNoteToTwitter; use App\Models\Note; use GuzzleHttp\Client; +use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Psr7\Response; -use GuzzleHttp\Handler\MockHandler; -use App\Jobs\SyndicateNoteToTwitter; use Illuminate\Foundation\Testing\DatabaseTransactions; +use Tests\TestCase; class SyndicateNoteToTwitterJobTest extends TestCase { use DatabaseTransactions; - public function test_the_job() + /** @test */ + public function weSyndicateNotesToTwitter(): void { $json = json_encode([ 'url' => 'https://twitter.com/i/web/status/123' diff --git a/tests/Unit/LikesTest.php b/tests/Unit/LikesTest.php index 54da41c3..6e11661f 100644 --- a/tests/Unit/LikesTest.php +++ b/tests/Unit/LikesTest.php @@ -1,23 +1,27 @@ author_url = 'https://joe.bloggs/'; $this->assertEquals('https://joe.bloggs', $like->author_url); } - public function test_plaintext_like_content() + /** @test */ + public function weDoNotModifyPlainTextContent(): void { $like = new Like(); $like->url = 'https://example.org/post/123'; @@ -27,27 +31,28 @@ class LikesTest extends TestCase $this->assertEquals('some plaintext content', $like->content); } - public function test_html_like_content_is_filtered() + /** @test */ + public function htmlLikeContentIsFiltered(): void { $htmlEvil = << -
-

Hello

- -
- -HTML; +
+
+

Hello

+ +
+
+ HTML; $htmlFiltered = <<Hello

- -HTML; +

Hello

+ + HTML; $like = new Like(); $like->url = 'https://example.org/post/123'; $like->content = $htmlEvil; $like->save(); - // HTMLPurifer will leave the whitespace before the tag - // trim it, saving whitespace in $htmlFilteres can get removed by text editors + // HTMLPurifier will leave the whitespace before the tag + // trim it, saving whitespace in $htmlFiltered can get removed by text editors $this->assertEquals($htmlFiltered, trim($like->content)); } } diff --git a/tests/Unit/MediaTest.php b/tests/Unit/MediaTest.php index 268068d0..a88003da 100644 --- a/tests/Unit/MediaTest.php +++ b/tests/Unit/MediaTest.php @@ -1,20 +1,24 @@ note; $this->assertInstanceOf('App\Models\Note', $note); } - public function test_media_absolute_url_returned_unmodified() + /** @test */ + public function absoluteUrlsAreReturnedUnmodified(): void { $absoluteUrl = 'https://instagram-cdn.com/image/uuid'; $media = new Media(); diff --git a/tests/Unit/MicropbClientsTest.php b/tests/Unit/MicropubClientsTest.php similarity index 63% rename from tests/Unit/MicropbClientsTest.php rename to tests/Unit/MicropubClientsTest.php index 2de9ce96..a812341e 100644 --- a/tests/Unit/MicropbClientsTest.php +++ b/tests/Unit/MicropubClientsTest.php @@ -1,15 +1,17 @@ assertInstanceOf(Collection::class, $client->notes); diff --git a/tests/Unit/NotesTest.php b/tests/Unit/NotesTest.php index af40d471..f4e125ba 100644 --- a/tests/Unit/NotesTest.php +++ b/tests/Unit/NotesTest.php @@ -1,14 +1,16 @@ Having a at the local. 🍺

' . PHP_EOL; $note = Note::find(2); $this->assertEquals($expected, $note->note); @@ -30,10 +34,12 @@ class NotesTest extends TestCase /** * Look for a default image in the contact’s h-card for the makeHCards method. * + * @test * @return void */ - public function test_default_image_used_in_makehcards_method() + public function defaultImageUsedAsFallbackInMakehcardsMethod(): void { + // phpcs:ignore $expected = '

Hi Tantek Çelik t

' . PHP_EOL; $note = Note::find(4); $this->assertEquals($expected, $note->note); @@ -42,10 +48,12 @@ class NotesTest extends TestCase /** * Look for a specific profile image in the contact’s h-card. * + * @test * @return void */ - public function test_specific_profile_image_used_in_makehcards_method() + public function specificProfileImageUsedInMakehcardsMethod(): void { + // phpcs:ignore $expected = '

Hi Aaron Parecki Facebook

' . PHP_EOL; $note = Note::find(5); $this->assertEquals($expected, $note->note); @@ -54,42 +62,48 @@ class NotesTest extends TestCase /** * Look for twitter URL when there’s no associated contact. * + * @test * @return void */ - public function test_twitter_link_created_when_no_contact_found() + public function twitterLinkIsCreatedWhenNoContactFound(): void { $expected = '

Hi @bob

' . PHP_EOL; $note = Note::find(6); $this->assertEquals($expected, $note->note); } - public function test_shorturl_method() + /** @test */ + public function shorturlMethodReturnsExpectedValue(): void { $note = Note::find(14); $this->assertEquals(config('app.shorturl') . '/notes/E', $note->shorturl); } - public function test_latlng_of_associated_place() + /** @test */ + public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void { $note = Note::find(2); // should be having beer at bridgewater note $this->assertEquals('53.4983', $note->latitude); $this->assertEquals('-2.3805', $note->longitude); } - public function test_latlng_returns_null_otherwise() + /** @test */ + public function whenNoAssociatedPlaceWeGetNullForLatitudeLongitudeValues(): void { $note = Note::find(5); $this->assertNull($note->latitude); $this->assertNull($note->longitude); } - public function test_address_attribute_for_places() + /** @test */ + public function weCanGetAddressAttributeForAssociatedPlace(): void { $note = Note::find(2); $this->assertEquals('The Bridgewater Pub', $note->address); } - public function test_deleting_event_observer() + /** @test */ + public function deletingNotesAlsoDeletesTagsViaTheEventObserver(): void { // first we’ll create a temporary note to delete $note = Note::create(['note' => 'temporary #temp']); @@ -104,7 +118,7 @@ class NotesTest extends TestCase } /** @test */ - public function blank_note_should_be_saved_as_null() + public function saveBlankNotesAsNull(): void { $note = new Note(['note' => '']); @@ -112,11 +126,13 @@ class NotesTest extends TestCase } /** @test */ - public function reverse_geocode_an_attraction() + public function reverseGeocodeAnAttraction(): void { + // phpcs:disable Generic.Files.LineLength.TooLong $json = << 'application/json'], $json), ]); @@ -128,15 +144,20 @@ JSON; $note = new Note(); $address = $note->reverseGeoCode(51.50084, -0.14264); - $this->assertEquals('Victoria, London, UK', $address); + $this->assertEquals( + 'Victoria, London, UK', + $address + ); } /** @test */ - public function reverse_geocode_a_suburb() + public function reverseGeocodeASuburb(): void { + // phpcs:disable Generic.Files.LineLength.TooLong $json = << 'application/json'], $json), ]); @@ -148,17 +169,22 @@ JSON; $note = new Note(); $address = $note->reverseGeoCode(51.02, 0.91); - $this->assertEquals('Newchurch, Shepway, UK', $address); + $this->assertEquals( + 'Newchurch, Shepway, UK', + $address + ); } /** @test */ - public function reverse_geocode_a_city() + public function reverseGeocodeACity(): void { // Note I’ve modified this JSON response so it only contains the // city the Uni is in + // phpcs:disable Generic.Files.LineLength.TooLong $json = << 'application/json'], $json), ]); @@ -170,17 +196,22 @@ JSON; $note = new Note(); $address = $note->reverseGeoCode(53.466277988406, -2.2304474827445); - $this->assertEquals('Manchester, UK', $address); + $this->assertEquals( + 'Manchester, UK', + $address + ); } /** @test */ - public function reverse_geocode_a_county() + public function reverseGeocodeACounty(): void { // Note I’ve removed everything below county to test for querires where // that’s all that is returned + // phpcs:disable Generic.Files.LineLength.TooLong $json = << 'application/json'], $json), ]); @@ -196,13 +227,15 @@ JSON; } /** @test */ - public function reverse_geocode_a_country() + public function reverseGeocodeACountry(): void { // Note I’ve removed everything below country to test for querires where // that’s all that is returned + // phpcs:disable Generic.Files.LineLength.TooLong $json = << 'application/json'], $json), ]); @@ -218,12 +251,12 @@ JSON; } /** @test */ - public function add_image_element_to_note_content() + public function addImageElementToNoteContentWhenMediaAssociated(): void { $media = new Media([ 'type' => 'image', - 'path' => 'test.png'] - ); + 'path' => 'test.png', + ]); $media->save(); $note = new Note(['note' => 'A nice image']); $note->save(); @@ -235,12 +268,12 @@ JSON; } /** @test */ - public function add_video_element_to_note_content() + public function addVideoElementToNoteContentWhenMediaAssociated(): void { $media = new Media([ 'type' => 'video', - 'path' => 'test.mkv'] - ); + 'path' => 'test.mkv', + ]); $media->save(); $note = new Note(['note' => 'A nice video']); $note->save(); @@ -252,12 +285,12 @@ JSON; } /** @test */ - public function add_audio_element_to_note_content() + public function addAudioElementToNoteContentWhenMediaAssociated(): void { $media = new Media([ 'type' => 'audio', - 'path' => 'test.flac'] - ); + 'path' => 'test.flac', + ]); $media->save(); $note = new Note(['note' => 'Some nice audio']); $note->save(); @@ -268,24 +301,29 @@ JSON; $this->assertEquals($expected, $note->content); } - /** @test */ - public function blank_note_content() + /** + * @test + * @todo Why do we need to provide text? + */ + public function provideTextForBlankContent(): void { $note = new Note(); $this->assertEquals('A blank note', $note->content); } - /** @test */ - public function twitter_content_is_null_when_oembed_error_occurs() + // @todo Sort out twitter requests + /** @test + public function setTwitterContentToNullWhenOembedErrorOccurs(): void { $note = new Note(); $note->in_reply_to = 'https://twitter.com/search'; $this->assertNull($note->twitter); - } + }*/ - public function test_markdown_gets_converted() + /** @test */ + public function markdownContentGetsConverted(): void { $note = Note::create([ 'note' => 'The best search engine? https://duckduckgo.com', diff --git a/tests/Unit/PlacesTest.php b/tests/Unit/PlacesTest.php index 32fef42a..d098bf80 100644 --- a/tests/Unit/PlacesTest.php +++ b/tests/Unit/PlacesTest.php @@ -1,55 +1,57 @@ assertInstanceOf(Collection::class, $place->notes); } - /** - * Test the near method returns a collection. - * - * @return void - */ - public function test_near_method() + /** @test */ + public function nearMethodReturnsCollection(): void { $nearby = Place::near((object) ['latitude' => 53.5, 'longitude' => -2.38], 1000)->get(); $this->assertEquals('the-bridgewater-pub', $nearby[0]->slug); } - public function test_longurl_method() + /** @test */ + public function getLongurl(): void { $place = Place::find(1); $this->assertEquals(config('app.url') . '/places/the-bridgewater-pub', $place->longurl); } - public function test_uri_method() - { - $place = Place::find(1); - $this->assertEquals(config('app.url') . '/places/the-bridgewater-pub', $place->uri); - - } - - public function test_shorturl_method() + /** @test */ + public function getShorturl() { $place = Place::find(1); $this->assertEquals(config('app.shorturl') . '/places/the-bridgewater-pub', $place->shorturl); } - public function test_service_returns_existing_place() + /** @test */ + public function getUri(): void + { + $place = Place::find(1); + $this->assertEquals(config('app.url') . '/places/the-bridgewater-pub', $place->uri); + } + + /** @test */ + public function placeServiceReturnsExistingPlaceBasedOnExternalUrlsSearch(): void { $place = new Place(); $place->name = 'Temp Place'; @@ -64,28 +66,31 @@ class PlacesTest extends TestCase ] ]); $this->assertInstanceOf('App\Models\Place', $ret); // a place was returned - $this->assertEquals(12, count(Place::all())); // still 2 places + $this->assertCount(12, Place::all()); // still 12 places } - public function test_service_requires_name() + /** @test */ + public function placeServiceRequiresNameWhenCreatingNewPlace(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Missing required name'); $service = new PlaceService(); $service->createPlaceFromCheckin(['foo' => 'bar']); } - public function test_service_requires_latitude() + /** @test */ + public function placeServiceRequiresLatitudeWhenCreatingNewPlace(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Missing required longitude/latitude'); $service = new PlaceService(); $service->createPlaceFromCheckin(['properties' => ['name' => 'bar']]); } - public function test_updating_external_urls() + /** @test */ + public function placeServcieCanupdateExternalUrls(): void { $place = Place::find(1); $place->external_urls = 'https://bridgewater.pub'; diff --git a/tests/Unit/TagsTest.php b/tests/Unit/TagsTest.php index a71cbde5..254c82c1 100644 --- a/tests/Unit/TagsTest.php +++ b/tests/Unit/TagsTest.php @@ -1,5 +1,7 @@ assertEquals(1, count($tag->notes)); + $this->assertCount(1, $tag->notes); } - public function test_bookmarks_method() + /** @test */ + public function canGetAssociatedBookmarks(): void { $tag = Tag::find(5); //should be first random tag for bookmarks - $this->assertEquals(1, count($tag->bookmarks)); + $this->assertCount(1, $tag->bookmarks); } } diff --git a/tests/Unit/WebMentionTest.php b/tests/Unit/WebMentionTest.php index 822d5286..6839e862 100644 --- a/tests/Unit/WebMentionTest.php +++ b/tests/Unit/WebMentionTest.php @@ -1,32 +1,38 @@ assertInstanceOf('App\Models\Note', $webmention->commentable); } - public function test_published_attribute_when_no_relavent_mf2() + + /** @test */ + public function publishedAttributeUsesUpdatedAtWhenNoRelevantMf2Data(): void { $webmention = new WebMention(); - $updated_at = carbon()->now(); + $updated_at = Carbon::now(); $webmention->updated_at = $updated_at; $this->assertEquals($updated_at->toDayDateTimeString(), $webmention->published); } - public function test_published_attribute_when_error_parsing_mf2() + /** @test */ + public function publishedAttributeUsesUpdatedAtWhenErrorParsingMf2Data(): void { $webmention = new WebMention(); - $updated_at = carbon()->now(); + $updated_at = Carbon::now(); $webmention->updated_at = $updated_at; $webmention->mf2 = json_encode([ 'items' => [[ @@ -40,12 +46,8 @@ class WebMentionTest extends TestCase $this->assertEquals($updated_at->toDayDateTimeString(), $webmention->published); } - /** - * Test a correct profile link is formed from a generic URL. - * - * @return void - */ - public function test_create_photo_link_with_non_cached_image() + /** @test */ + public function createPhotoLinkDoesNothingWithGenericUrlAndNoLocallySavedImage(): void { $webmention = new WebMention(); $homepage = 'https://example.org/profile.png'; @@ -53,12 +55,8 @@ class WebMentionTest extends TestCase $this->assertEquals($expected, $webmention->createPhotoLink($homepage)); } - /** - * Test a correct profile link is formed from a generic URL (cached). - * - * @return void - */ - public function test_create_photo_link_with_cached_image() + /** @test */ + public function createPhotoLinkReturnsLocallySavedImageUrlIfItExists(): void { $webmention = new WebMention(); $homepage = 'https://aaronparecki.com/profile.png'; @@ -66,12 +64,8 @@ class WebMentionTest extends TestCase $this->assertEquals($expected, $webmention->createPhotoLink($homepage)); } - /** - * Test a correct profile link is formed from a twitter URL. - * - * @return void - */ - public function test_create_photo_link_with_twimg_profile_image_url() + /** @test */ + public function createPhotoLinkDealsWithSpecialCaseOfDirectTwitterPhotoLinks(): void { $webmention = new WebMention(); $twitterProfileImage = 'http://pbs.twimg.com/1234'; @@ -79,12 +73,8 @@ class WebMentionTest extends TestCase $this->assertEquals($expected, $webmention->createPhotoLink($twitterProfileImage)); } - /** - * Test `null` is returned for a twitter profile. - * - * @return void - */ - public function test_create_photo_link_with_cached_twitter_url() + /** @test */ + public function createPhotoLinkReturnsCachedTwitterPhotoLinks(): void { $webmention = new WebMention(); $twitterURL = 'https://twitter.com/example'; @@ -93,10 +83,12 @@ class WebMentionTest extends TestCase $this->assertEquals($expected, $webmention->createPhotoLink($twitterURL)); } - public function test_create_photo_link_with_noncached_twitter_url() + /** @test */ + public function createPhotoLinkResolvesTwitterPhotoLinks(): void { - $info = new \stdClass(); - $info->profile_image_url_https = 'https://pbs.twimg.com/static_profile_link.jpg'; + $info = (object) [ + 'profile_image_url_https' => 'https://pbs.twimg.com/static_profile_link.jpg', + ]; $codebirdMock = $this->getMockBuilder(Codebird::class) ->addMethods(['users_show']) ->getMock(); @@ -117,13 +109,15 @@ class WebMentionTest extends TestCase $this->assertEquals($expected, $webmention->createPhotoLink($twitterURL)); } - public function test_get_reply_attribute_returns_null() + /** @test */ + public function getReplyAttributeDefaultsToNull(): void { $webmention = new WebMention(); $this->assertNull($webmention->reply); } - public function test_get_reply_attribute_with_mf2_without_html_returns_null() + /** @test */ + public function getReplyAttributeWithMf2WithoutHtmlReturnsNull(): void { $webmention = new WebMention(); $webmention->mf2 = json_encode(['no_html' => 'found_here']);