From 4285446e3adccc3d6d9824695ecdf9a641d9927c Mon Sep 17 00:00:00 2001 From: David Yell Date: Fri, 12 Oct 2018 15:30:37 +0100 Subject: [PATCH 1/9] Use the new seo redirector to find the right urls --- composer.json | 5 +- composer.lock | 564 ++++++++++++++++++++++++++++---------------------- 2 files changed, 317 insertions(+), 252 deletions(-) diff --git a/composer.json b/composer.json index dd0c090..def900b 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,9 @@ } ], "require": { - "php": ">=7.1", - "cakephp/cakephp": "~3.4" + "php": ">=7.2", + "cakephp/cakephp": "~3.6", + "davidyell/seo-redirector": "0.0.1" }, "require-dev": { "phpunit/phpunit": "*", diff --git a/composer.lock b/composer.lock index 8c39d2c..75b6f4e 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6cb779db8f81d39924ac7bb3d3d06ba8", + "content-hash": "d65ae01727e82e4321c92a9ecf8a6dcc", "packages": [ { "name": "aura/intl", @@ -54,21 +54,21 @@ }, { "name": "cakephp/cakephp", - "version": "3.5.11", + "version": "3.6.12", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "b557240fc11cdce9e60d35d4a911c01c0f28b5ee" + "reference": "cb3034e636e256e8726e3a4383e5ae77fe4e86ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/b557240fc11cdce9e60d35d4a911c01c0f28b5ee", - "reference": "b557240fc11cdce9e60d35d4a911c01c0f28b5ee", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/cb3034e636e256e8726e3a4383e5ae77fe4e86ef", + "reference": "cb3034e636e256e8726e3a4383e5ae77fe4e86ef", "shasum": "" }, "require": { "aura/intl": "^3.0.0", - "cakephp/chronos": "^1.0.0", + "cakephp/chronos": "^1.0.1", "ext-intl": "*", "ext-mbstring": "*", "php": ">=5.6.0", @@ -136,20 +136,20 @@ "rapid-development", "validation" ], - "time": "2018-01-21T00:04:21+00:00" + "time": "2018-10-02T01:46:03+00:00" }, { "name": "cakephp/chronos", - "version": "1.1.4", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/cakephp/chronos.git", - "reference": "85bcaea6a832684b32ef54b2487b0c14a172e9e6" + "reference": "30f5b26bcf76a5e53ecc274700ad1ec49dc05567" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/85bcaea6a832684b32ef54b2487b0c14a172e9e6", - "reference": "85bcaea6a832684b32ef54b2487b0c14a172e9e6", + "url": "https://api.github.com/repos/cakephp/chronos/zipball/30f5b26bcf76a5e53ecc274700ad1ec49dc05567", + "reference": "30f5b26bcf76a5e53ecc274700ad1ec49dc05567", "shasum": "" }, "require": { @@ -157,15 +157,15 @@ }, "require-dev": { "athletic/athletic": "~0.1", - "cakephp/cakephp-codesniffer": "~2.3", + "cakephp/cakephp-codesniffer": "^3.0", "phpbench/phpbench": "@dev", "phpstan/phpstan": "^0.6.4", - "phpunit/phpunit": "<6.0" + "phpunit/phpunit": "<6.0 || ^7.0" }, "type": "library", "autoload": { "psr-4": { - "Cake\\Chronos\\": "src" + "Cake\\Chronos\\": "src/" }, "files": [ "src/carbon_compat.php" @@ -193,7 +193,45 @@ "datetime", "time" ], - "time": "2018-01-13T12:19:50+00:00" + "time": "2018-07-11T18:51:56+00:00" + }, + { + "name": "davidyell/seo-redirector", + "version": "0.0.1", + "source": { + "type": "git", + "url": "https://github.com/davidyell/SeoRedirector.git", + "reference": "6117c9bff3b493004e088070cc8ab5043ab46be3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/davidyell/SeoRedirector/zipball/6117c9bff3b493004e088070cc8ab5043ab46be3", + "reference": "6117c9bff3b493004e088070cc8ab5043ab46be3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Redirector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Yell", + "email": "dyell@ukwebmedia.com" + } + ], + "time": "2018-10-12T13:56:41+00:00" }, { "name": "psr/http-message", @@ -294,16 +332,16 @@ }, { "name": "zendframework/zend-diactoros", - "version": "1.7.0", + "version": "1.8.6", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7" + "reference": "20da13beba0dde8fb648be3cc19765732790f46e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/ed6ce7e2105c400ca10277643a8327957c0384b7", - "reference": "ed6ce7e2105c400ca10277643a8327957c0384b7", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/20da13beba0dde8fb648be3cc19765732790f46e", + "reference": "20da13beba0dde8fb648be3cc19765732790f46e", "shasum": "" }, "require": { @@ -316,17 +354,29 @@ "require-dev": { "ext-dom": "*", "ext-libxml": "*", - "phpunit/phpunit": "^5.7.16 || ^6.0.8", + "php-http/psr7-integration-tests": "dev-master", + "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7", "zendframework/zend-coding-standard": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev", - "dev-develop": "1.8.x-dev" + "dev-master": "1.8.x-dev", + "dev-develop": "1.9.x-dev", + "dev-release-2.0": "2.0.x-dev" } }, "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php" + ], "psr-4": { "Zend\\Diactoros\\": "src/" } @@ -342,22 +392,22 @@ "psr", "psr-7" ], - "time": "2018-01-04T18:21:48+00:00" + "time": "2018-09-05T19:29:37+00:00" } ], "packages-dev": [ { "name": "cakephp/cakephp-codesniffer", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "d77ac81199f2f1e5a8d8ebf96a5d6d7cd4e0542b" + "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/d77ac81199f2f1e5a8d8ebf96a5d6d7cd4e0542b", - "reference": "d77ac81199f2f1e5a8d8ebf96a5d6d7cd4e0542b", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7f467fee00fd016b62cf8c85a57750ab2a895e81", + "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81", "shasum": "" }, "require": { @@ -389,7 +439,7 @@ "codesniffer", "framework" ], - "time": "2017-12-21T20:01:35+00:00" + "time": "2018-06-09T16:01:01+00:00" }, { "name": "doctrine/instantiator", @@ -447,16 +497,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { @@ -466,7 +516,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.0" }, "suggest": { @@ -475,7 +525,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -508,7 +558,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", @@ -628,25 +678,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -669,26 +722,26 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -724,20 +777,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -771,7 +824,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -927,33 +980,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.3", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -986,44 +1039,44 @@ "spy", "stub" ], - "time": "2017-11-24T13:59:53+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.0", + "version": "6.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + "reference": "848f78b3309780fef7ec8c4666b7ab4e6b09b22f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/848f78b3309780fef7ec8c4666b7ab4e6b09b22f", + "reference": "848f78b3309780fef7ec8c4666b7ab4e6b09b22f", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -1049,29 +1102,32 @@ "testing", "xunit" ], - "time": "2017-12-06T09:29:45+00:00" + "time": "2018-10-04T03:41:23+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1086,7 +1142,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1096,7 +1152,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -1141,28 +1197,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1177,7 +1233,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1186,33 +1242,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1235,57 +1291,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-02-01T13:16:43+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.6", + "version": "7.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe" + "reference": "f3837fa1e07758057ae06e8ddec6d06ba183f126" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3330ef26ade05359d006041316ed0fa9e8e3cefe", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3837fa1e07758057ae06e8ddec6d06ba183f126", + "reference": "f3837fa1e07758057ae06e8ddec6d06ba183f126", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.5", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1293,7 +1349,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -1319,66 +1375,7 @@ "testing", "xunit" ], - "time": "2018-02-01T05:57:37+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-01-06T05:45:45+00:00" + "time": "2018-10-05T04:05:24+00:00" }, { "name": "satooshi/php-coveralls", @@ -1510,30 +1507,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.2", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "11c07feade1d65453e06df3b3b90171d6d982087" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/11c07feade1d65453e06df3b3b90171d6d982087", - "reference": "11c07feade1d65453e06df3b3b90171d6d982087", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1570,32 +1567,33 @@ "compare", "equality" ], - "time": "2018-01-12T06:34:42+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1620,9 +1618,12 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", @@ -1939,25 +1940,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1977,7 +1978,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -2024,16 +2025,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.2.2", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1" + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", - "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", "shasum": "" }, "require": { @@ -2043,7 +2044,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ "bin/phpcs", @@ -2071,30 +2072,33 @@ "phpcs", "standards" ], - "time": "2017-12-19T21:44:46+00:00" + "time": "2018-09-23T23:08:17+00:00" }, { "name": "symfony/config", - "version": "v4.0.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2" + "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ecd917899167922086ddb3247aa43eb1c418fcb2", - "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2", + "url": "https://api.github.com/repos/symfony/config/zipball/b3d4d7b567d7a49e6dfafb6d4760abc921177c96", + "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0" + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" }, "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, @@ -2104,7 +2108,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2131,20 +2135,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:06:11+00:00" + "time": "2018-09-08T13:24:10+00:00" }, { "name": "symfony/console", - "version": "v4.0.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "url": "https://api.github.com/repos/symfony/console/zipball/dc7122fe5f6113cfaba3b3de575d31112c9aa60b", + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b", "shasum": "" }, "require": { @@ -2164,7 +2168,7 @@ "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2172,7 +2176,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2199,29 +2203,30 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2018-10-03T08:15:46+00:00" }, { "name": "symfony/filesystem", - "version": "v4.0.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed" + "reference": "596d12b40624055c300c8b619755b748ca5cf0b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/760e47a4ee64b4c48f4b30017011e09d4c0f05ed", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/596d12b40624055c300c8b619755b748ca5cf0b5", + "reference": "596d12b40624055c300c8b619755b748ca5cf0b5", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2248,20 +2253,78 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-10-02T12:40:59+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -2273,7 +2336,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -2307,20 +2370,20 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.0.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704" + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d52321f0e2b596bd03b5d1dd6eebe71caa925704", - "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5bfc064125b73ff81229e19381ce1c34d3416f4b", + "reference": "5bfc064125b73ff81229e19381ce1c34d3416f4b", "shasum": "" }, "require": { @@ -2329,7 +2392,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2356,24 +2419,25 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/yaml", - "version": "v4.0.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028" + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ffc60bda1d4a00ec0b32eeabf39dc017bf480028", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" @@ -2387,7 +2451,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2414,7 +2478,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:06:11+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "theseer/tokenizer", @@ -2513,7 +2577,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1" + "php": ">=7.2" }, "platform-dev": [] } From 9855691f8d12abe356733a577a21a6ecc6784089 Mon Sep 17 00:00:00 2001 From: David Yell Date: Fri, 12 Oct 2018 15:49:29 +0100 Subject: [PATCH 2/9] Bumped the requirements to reflect the composer file --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a8eaaa0..06d70c4 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ data into the view variables. I found that by containing all the functionality for SEO inside a component it makes it easier to manage. # Requirements -* CakePHP 3.4+ -* PHP 7.1+ +* CakePHP 3.6+ +* PHP 7.2+ # Installation [https://packagist.org/packages/davidyell/seo](https://packagist.org/packages/davidyell/seo) @@ -92,4 +92,4 @@ Don't forget that you can set the config directly on an instance of the componen // ExamplesController.php $this->components()->get('Seo')->setConfig('fields.title', 'My new title'); -``` \ No newline at end of file +``` From e65c6c664b7762f065d4a37c9faa9cb465b59814 Mon Sep 17 00:00:00 2001 From: David Yell Date: Fri, 12 Oct 2018 15:50:03 +0100 Subject: [PATCH 3/9] Added the basic error handler middleware --- .../Middleware/ErrorHandlerMiddleware.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/Error/Middleware/ErrorHandlerMiddleware.php diff --git a/src/Error/Middleware/ErrorHandlerMiddleware.php b/src/Error/Middleware/ErrorHandlerMiddleware.php new file mode 100644 index 0000000..73cfc21 --- /dev/null +++ b/src/Error/Middleware/ErrorHandlerMiddleware.php @@ -0,0 +1,62 @@ + + */ +class ErrorHandlerMiddleware extends \Cake\Error\Middleware\ErrorHandlerMiddleware +{ + /** + * Redirects mapping + * + * Array of redirects in the form of + * [ + * '/url/to/redirect' => [ + * 'target' => '/target/url', + * 'code' => 302 + * ] + * ] + * + * @see SeoRedirector Tests for more examples + * @var array + */ + private $redirects = []; + + /** + * Handle an exception and generate an error response + * + * @param Exception $exception The exception to handle. + * @param \Psr\Http\Message\ServerRequestInterface $request The request. + * @param \Psr\Http\Message\ResponseInterface $response The response. + * @return \Psr\Http\Message\ResponseInterface A response + * @throws Exception + */ + public function handleException($exception, $request, $response): ResponseInterface + { + if ($exception instanceof NotFoundException || $exception instanceof MissingRouteException) { + $redirector = new Redirector($this->redirects); + $redirect = $redirector->find($request->getUri()->getPath()); + + if ($redirect instanceof FailedUrl) { + return new TextResponse($redirect->getText(), $redirect->getCode()); + } + + if ($redirect instanceof RedirectUrl) { + return new RedirectResponse($redirect->getUrl(), $redirect->getCode()); + } + } + + return parent::handleException($exception, $request, $response); + } +} From 46b06043f320935ef52afe10785798c2eccd9f91 Mon Sep 17 00:00:00 2001 From: David Yell Date: Fri, 12 Oct 2018 16:29:53 +0100 Subject: [PATCH 4/9] Don't try and find redirects if there are none --- .../Middleware/ErrorHandlerMiddleware.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Error/Middleware/ErrorHandlerMiddleware.php b/src/Error/Middleware/ErrorHandlerMiddleware.php index 73cfc21..f881a31 100644 --- a/src/Error/Middleware/ErrorHandlerMiddleware.php +++ b/src/Error/Middleware/ErrorHandlerMiddleware.php @@ -33,6 +33,25 @@ class ErrorHandlerMiddleware extends \Cake\Error\Middleware\ErrorHandlerMiddlewa */ private $redirects = []; + /** + * Constructor + * + * @param string|callable|null $exceptionRenderer The renderer or class name + * to use or a callable factory. If null, Configure::read('Error.exceptionRenderer') + * will be used. + * @param array $config Configuration options to use. If empty, `Configure::read('Error')` + * will be used. + * @param array $redirects + */ + public function __construct($exceptionRenderer = null, array $config = [], array $redirects = []) + { + parent::__construct($exceptionRenderer, $config); + + if (!empty($redirects)) { + $this->redirects = $redirects; + } + } + /** * Handle an exception and generate an error response * @@ -44,6 +63,10 @@ class ErrorHandlerMiddleware extends \Cake\Error\Middleware\ErrorHandlerMiddlewa */ public function handleException($exception, $request, $response): ResponseInterface { + if (empty($this->redirects)) { + return parent::handleException($exception, $request, $response); + } + if ($exception instanceof NotFoundException || $exception instanceof MissingRouteException) { $redirector = new Redirector($this->redirects); $redirect = $redirector->find($request->getUri()->getPath()); From 7bbeefe6eee25d2de9033e04e98deab07a750353 Mon Sep 17 00:00:00 2001 From: David Yell Date: Fri, 12 Oct 2018 16:36:58 +0100 Subject: [PATCH 5/9] Simplified the constructor --- src/Error/Middleware/ErrorHandlerMiddleware.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Error/Middleware/ErrorHandlerMiddleware.php b/src/Error/Middleware/ErrorHandlerMiddleware.php index f881a31..761572d 100644 --- a/src/Error/Middleware/ErrorHandlerMiddleware.php +++ b/src/Error/Middleware/ErrorHandlerMiddleware.php @@ -36,20 +36,15 @@ class ErrorHandlerMiddleware extends \Cake\Error\Middleware\ErrorHandlerMiddlewa /** * Constructor * - * @param string|callable|null $exceptionRenderer The renderer or class name - * to use or a callable factory. If null, Configure::read('Error.exceptionRenderer') - * will be used. - * @param array $config Configuration options to use. If empty, `Configure::read('Error')` - * will be used. - * @param array $redirects + * @param array $redirects Array of redirects to process */ - public function __construct($exceptionRenderer = null, array $config = [], array $redirects = []) + public function __construct(array $redirects = []) { - parent::__construct($exceptionRenderer, $config); - if (!empty($redirects)) { $this->redirects = $redirects; } + + parent::__construct(); } /** From 56c6cc758ad28c58edc51b2343aefe122aca6822 Mon Sep 17 00:00:00 2001 From: David Yell Date: Mon, 15 Oct 2018 10:49:17 +0100 Subject: [PATCH 6/9] Updated to a new version of the redirector which supports multi-slug urls --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index def900b..1dfe8bb 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": ">=7.2", "cakephp/cakephp": "~3.6", - "davidyell/seo-redirector": "0.0.1" + "davidyell/seo-redirector": "^0" }, "require-dev": { "phpunit/phpunit": "*", From 583ff03035216b87b3b6eaad8eb1854e7b8756d0 Mon Sep 17 00:00:00 2001 From: David Yell Date: Mon, 15 Oct 2018 11:54:59 +0100 Subject: [PATCH 7/9] Added a note to the readme about the middleware --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 06d70c4..8267f77 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,20 @@ Don't forget that you can set the config directly on an instance of the componen $this->components()->get('Seo')->setConfig('fields.title', 'My new title'); ``` + +# Error handler middleware +It is very helpful to be able to catch 404 errors and use them to manage your SEO redirecting. This allows for only urls +which do not match your application to be redirecting, avoiding any overhead. + +The plugin provides a basic middleware for this purpose which can be implemented into your `/src/Application.php` + +``` +$this->redirects = [ + '/examples/first-example' => [ + 'target' => '/tutorials/first', + 'code' => 301 + ] +]; +$queue->add(new \Seo\Error\Middleware\ErrorHandlerMiddleware($this->redirects)) +``` + From 378aab655c20a2b336b445d7cf2605677c2b4156 Mon Sep 17 00:00:00 2001 From: David Yell Date: Mon, 15 Oct 2018 11:57:51 +0100 Subject: [PATCH 8/9] Updated the travis config to reflect the minimum php reqiurements --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index dcf9eb7..4efe78e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: php php: - - 7.1 - 7.2 sudo: false @@ -15,13 +14,13 @@ matrix: fast_finish: true include: - - php: 7.1 + - php: 7.2 env: DEFAULT=1 - - php: 7.1 + - php: 7.2 env: PHPCS=1 DEFAULT=0 - - php: 7.1 + - php: 7.2 env: COVERALLS=1 DEFAULT=0 install: From 742994a7c237262154c160ad69987373e3e96745 Mon Sep 17 00:00:00 2001 From: David Yell Date: Mon, 15 Oct 2018 12:05:17 +0100 Subject: [PATCH 9/9] Fixed the test suite to remove the deprecated methods --- composer.json | 2 +- composer.lock | 268 +++++++++++------- phpunit.xml.dist | 11 +- .../Controller/Component/SeoComponentTest.php | 2 +- tests/TestCase/View/Helper/SeoHelperTest.php | 14 +- 5 files changed, 171 insertions(+), 126 deletions(-) diff --git a/composer.json b/composer.json index 1dfe8bb..8e3f8be 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "davidyell/seo-redirector": "^0" }, "require-dev": { - "phpunit/phpunit": "*", + "phpunit/phpunit": "^5.7.14|^6.0", "cakephp/cakephp-codesniffer": "~3.0", "satooshi/php-coveralls": "^2.0" }, diff --git a/composer.lock b/composer.lock index 75b6f4e..9da0271 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d65ae01727e82e4321c92a9ecf8a6dcc", + "content-hash": "ada6e8611a59c75aab35e2cbe11e6d08", "packages": [ { "name": "aura/intl", @@ -197,23 +197,24 @@ }, { "name": "davidyell/seo-redirector", - "version": "0.0.1", + "version": "0.0.3", "source": { "type": "git", "url": "https://github.com/davidyell/SeoRedirector.git", - "reference": "6117c9bff3b493004e088070cc8ab5043ab46be3" + "reference": "69b460f57e4b22beca1e38f25accbf9d60ff5fbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/davidyell/SeoRedirector/zipball/6117c9bff3b493004e088070cc8ab5043ab46be3", - "reference": "6117c9bff3b493004e088070cc8ab5043ab46be3", + "url": "https://api.github.com/repos/davidyell/SeoRedirector/zipball/69b460f57e4b22beca1e38f25accbf9d60ff5fbd", + "reference": "69b460f57e4b22beca1e38f25accbf9d60ff5fbd", "shasum": "" }, "require": { "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^7.4" + "phpunit/phpunit": "^7.4", + "squizlabs/php_codesniffer": "^3.3" }, "type": "library", "autoload": { @@ -231,7 +232,7 @@ "email": "dyell@ukwebmedia.com" } ], - "time": "2018-10-12T13:56:41+00:00" + "time": "2018-10-15T10:47:56+00:00" }, { "name": "psr/http-message", @@ -726,22 +727,22 @@ }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", + "phar-io/version": "^1.0.1", "php": "^5.6 || ^7.0" }, "type": "library", @@ -777,20 +778,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" + "time": "2017-03-05T18:14:27+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", "shasum": "" }, "require": { @@ -824,7 +825,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1043,40 +1044,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.0.8", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "848f78b3309780fef7ec8c4666b7ab4e6b09b22f" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/848f78b3309780fef7ec8c4666b7ab4e6b09b22f", - "reference": "848f78b3309780fef7ec8c4666b7ab4e6b09b22f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^2.0.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", + "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -1102,32 +1103,29 @@ "testing", "xunit" ], - "time": "2018-10-04T03:41:23+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -1142,7 +1140,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -1152,7 +1150,7 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1197,28 +1195,28 @@ }, { "name": "phpunit/php-timer", - "version": "2.0.0", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", - "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1233,7 +1231,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", + "email": "sb@sebastian-bergmann.de", "role": "lead" } ], @@ -1242,33 +1240,33 @@ "keywords": [ "timer" ], - "time": "2018-02-01T13:07:23+00:00" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.1" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1291,57 +1289,57 @@ "keywords": [ "tokenizer" ], - "time": "2018-02-01T13:16:43+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "7.4.0", + "version": "6.5.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3837fa1e07758057ae06e8ddec6d06ba183f126" + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3837fa1e07758057ae06e8ddec6d06ba183f126", - "reference": "f3837fa1e07758057ae06e8ddec6d06ba183f126", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^1.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpunit/phpunit-mock-objects": "*" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { - "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1349,7 +1347,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -1375,7 +1373,66 @@ "testing", "xunit" ], - "time": "2018-10-05T04:05:24+00:00" + "time": "2018-09-08T15:10:43+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-08-09T05:50:03+00:00" }, { "name": "satooshi/php-coveralls", @@ -1458,6 +1515,7 @@ "github", "test" ], + "abandoned": "php-coveralls/php-coveralls", "time": "2017-12-08T14:28:16+00:00" }, { @@ -1507,30 +1565,30 @@ }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1567,33 +1625,32 @@ "compare", "equality" ], - "time": "2018-07-12T15:12:46+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "3.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "366541b989927187c4ca70490a35615d3fef2dce" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", - "reference": "366541b989927187c4ca70490a35615d3fef2dce", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1618,12 +1675,9 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "diff" ], - "time": "2018-06-10T07:54:39+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", @@ -1940,25 +1994,25 @@ }, { "name": "sebastian/resource-operations", - "version": "2.0.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1978,7 +2032,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f19b864..1865cad 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,17 +11,8 @@ - - - ./vendor/ - ./vendor/ - - ./tests/ - ./tests/ - - ./src - \ No newline at end of file + diff --git a/tests/TestCase/Controller/Component/SeoComponentTest.php b/tests/TestCase/Controller/Component/SeoComponentTest.php index 9d503f4..b3b6c84 100644 --- a/tests/TestCase/Controller/Component/SeoComponentTest.php +++ b/tests/TestCase/Controller/Component/SeoComponentTest.php @@ -49,7 +49,7 @@ class SeoComponentTest extends TestCase public function setUp() { $this->Controller = new Controller(); - $this->Controller->name = 'TestsController'; + $this->Controller->setName('TestsController'); $this->ComponentRegistry = new ComponentRegistry($this->Controller); $this->Seo = new SeoComponent($this->ComponentRegistry); } diff --git a/tests/TestCase/View/Helper/SeoHelperTest.php b/tests/TestCase/View/Helper/SeoHelperTest.php index 6d3b1ee..82f4dc6 100644 --- a/tests/TestCase/View/Helper/SeoHelperTest.php +++ b/tests/TestCase/View/Helper/SeoHelperTest.php @@ -117,7 +117,7 @@ public function testPagination(array $pagingArray, array $urls, $expected) ]); $this->Controller = new Controller($this->Request); - $this->Controller->name = 'Tests'; + $this->Controller->setName('Tests'); $this->View = new View($this->Request); @@ -131,18 +131,18 @@ public function testPagination(array $pagingArray, array $urls, $expected) if ($pagingArray['Tests']['prevPage']) { $helper->expects($this->at(0)) ->method('pageLink') - ->with($this->Controller->name, $pagingArray['Tests']['page'], 'prev') + ->with($this->Controller->getname(), $pagingArray['Tests']['page'], 'prev') ->willReturn($urls['prev']); } if ($pagingArray['Tests']['nextPage']) { $helper->expects($this->at(1)) ->method('pageLink') - ->with($this->Controller->name, $pagingArray['Tests']['page'], 'next') + ->with($this->Controller->getname(), $pagingArray['Tests']['page'], 'next') ->willReturn($urls['next']); } - $result = $helper->pagination($this->Controller->name); + $result = $helper->pagination($this->Controller->getname()); $this->assertEquals($expected, $result); } @@ -185,7 +185,7 @@ public function testCanonical($here, $expected) $this->Request = new ServerRequest($here); $this->Controller = new Controller($this->Request); - $this->Controller->name = 'Tests'; + $this->Controller->setName('Tests'); $this->View = new View($this->Request); @@ -213,7 +213,7 @@ public function testNonPaginatedController() ]); $this->Controller = new Controller($this->Request); - $this->Controller->name = 'Tests'; + $this->Controller->setName('Tests'); $this->View = new View($this->Request); @@ -228,7 +228,7 @@ public function testNonPaginatedController() $helper->expects($this->never()) ->method('pageLink'); - $result = $helper->pagination($this->Controller->name); + $result = $helper->pagination($this->Controller->getName()); $this->assertNull($result); }