diff --git a/composer.json b/composer.json index faf2774db..9a5cea988 100644 --- a/composer.json +++ b/composer.json @@ -14,11 +14,11 @@ "donatj/phpuseragentparser": "*", "enyo/dropzone": "^5.1", "league/commonmark": "^0.18", - "mirko-pagliai/cakephp-database-backup": "^2.5", + "mirko-pagliai/cakephp-database-backup": "^2.6.1", "mirko-pagliai/cakephp-entity-file-log": "^1.0", - "mirko-pagliai/cakephp-recaptcha-mailhide": "^1.2", + "mirko-pagliai/cakephp-recaptcha-mailhide": "^1.2.2", "mirko-pagliai/cakephp-stop-spam": "^1.0.2", - "mirko-pagliai/cakephp-thumber": "^1.5.2", + "mirko-pagliai/cakephp-thumber": "^1.7.1", "mirko-pagliai/cakephp-tokens": "^1.2", "mirko-pagliai/me-tools": "^2.18.11", "mirko-pagliai/php-tools": "^1.2.8", @@ -27,8 +27,8 @@ }, "require-dev": { "cakephp/cakephp-codesniffer": "^3.0", - "mirko-pagliai/cakephp-assets": "^1.3", - "phpunit/phpunit": "^5.7|^6.0" + "mirko-pagliai/cakephp-assets": "^1.4.1", + "phpunit/phpunit": "^5.7.14|^6.0" }, "suggest": { "cakephp/debug_kit": "Debug Toolbar for CakePHP applications", diff --git a/src/Utility/StaticPage.php b/src/Utility/StaticPage.php index 15c6523c3..081f44c31 100644 --- a/src/Utility/StaticPage.php +++ b/src/Utility/StaticPage.php @@ -46,7 +46,9 @@ protected static function getAllPaths() $paths = array_merge($paths, self::getPaths($plugin)); } - return array_filter($paths, 'file_exists'); + return array_clean(array_map(function ($path) { + return rtrim($path, DS); + }, $paths), 'file_exists'); }, 'static_pages'); } diff --git a/tests/TestCase/Utility/StaticPageTest.php b/tests/TestCase/Utility/StaticPageTest.php index 638ec645a..b3f9ee0d4 100644 --- a/tests/TestCase/Utility/StaticPageTest.php +++ b/tests/TestCase/Utility/StaticPageTest.php @@ -148,9 +148,9 @@ public function testGetAllPaths() { $this->loadPlugins(['TestPlugin']); $result = $this->invokeMethod(StaticPage::class, 'getAllPaths'); - $this->assertContains(APP . 'Template' . DS . 'StaticPages' . DS, $result); - $this->assertContains(ROOT . 'src' . DS . 'Template' . DS . 'StaticPages' . DS, $result); - $this->assertContains(Plugin::path('TestPlugin') . 'src' . DS . 'Template' . DS . 'StaticPages' . DS, $result); + $this->assertContains(APP . 'Template' . DS . 'StaticPages', $result); + $this->assertContains(ROOT . 'src' . DS . 'Template' . DS . 'StaticPages', $result); + $this->assertContains(Plugin::path('TestPlugin') . 'src' . DS . 'Template' . DS . 'StaticPages', $result); $this->assertEquals(Cache::read('paths', 'static_pages'), $result); }