From c41c2e9b1c14e0de1fad18e6361ff59f04432732 Mon Sep 17 00:00:00 2001 From: ryuring Date: Sun, 6 Oct 2024 18:40:00 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/TestCase/Service/ContentsServiceTest.php | 8 ++++---- plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php | 1 - .../tests/TestCase/View/Helper/BcBaserHelperTest.php | 2 +- .../bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/baser-core/tests/TestCase/Service/ContentsServiceTest.php b/plugins/baser-core/tests/TestCase/Service/ContentsServiceTest.php index 73cce3cf7c..18361108d2 100644 --- a/plugins/baser-core/tests/TestCase/Service/ContentsServiceTest.php +++ b/plugins/baser-core/tests/TestCase/Service/ContentsServiceTest.php @@ -462,7 +462,7 @@ public function testGetUrl($host, $userAgent, $url, $full, $useSubDomain, $expec } // Router::setRequestInfo($this->_getRequest('/m/')); $result = $this->ContentsService->getUrl($url, $full, $useSubDomain); - $this->assertEquals($result, $expects); + $this->assertEquals($expects, $result); Configure::write('BcEnv.siteUrl', $siteUrl); } @@ -489,9 +489,9 @@ public static function getUrlDataProvider() ['main.com', '', '/news/archives/1', true, false, 'http://main.com/news/archives/1'], ['main.com', 'SoftBank', '/m/news/archives/1', true, false, 'http://main.com/m/news/archives/1'], ['main.com', 'iPhone', '/news/archives/1', true, false, 'http://main.com/news/archives/1'], // 同一URL - ['sub.main.com', '', '/sub/', true, true, 'http://sub.main.com/'], - ['sub.main.com', '', '/sub/index', true, true, 'http://sub.main.com/'], - ['sub.main.com', '', '/sub/news/archives/1', true, true, 'http://sub.main.com/news/archives/1'], + ['sub.main.com', '', '/sub/', true, true, 'https://sub.main.com/'], + ['sub.main.com', '', '/sub/index', true, true, 'https://sub.main.com/'], + ['sub.main.com', '', '/sub/news/archives/1', true, true, 'https://sub.main.com/news/archives/1'], // ['another.com', '', '/another.com/', true, true, 'http://another.com/'], // ['another.com', '', '/another.com/index', true, true, 'http://another.com/'], // ['another.com', '', '/another.com/news/archives/1', true, true, 'http://another.com/news/archives/1'], diff --git a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php index 76c7465581..e0f3e0355b 100644 --- a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php +++ b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php @@ -841,7 +841,6 @@ public function testGetPrefix() */ public function testGetCurrentDomain() { - $this->assertEmpty(BcUtil::getCurrentDomain(), '$_SERVER[HTTP_HOST] の値が間違っています。'); Configure::write('BcEnv.host', 'hoge'); $this->assertEquals('hoge', BcUtil::getCurrentDomain(), 'ホストを変更できません。'); } diff --git a/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php b/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php index 9467d8826e..bd979449b7 100644 --- a/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php +++ b/plugins/baser-core/tests/TestCase/View/Helper/BcBaserHelperTest.php @@ -2013,7 +2013,7 @@ public function testGetContentsUrl() // サブドメインの指定がある場合 Configure::write('BcEnv.host', 'localhost'); $this->BcBaser = new BcBaserHelper(new View($this->getRequest('/'))); - $this->assertEquals('http://another.com/news/', $this->BcBaser->getContentsUrl('another.com/news/', true, true)); + $this->assertEquals('https://another.com/news/', $this->BcBaser->getContentsUrl('another.com/news/', true, true)); // サブドメインの指定がないのに指定ありとした場合 Configure::write('BcEnv.siteUrl', 'http://main.com'); $this->assertEquals('http://main.com/news/', $this->BcBaser->getContentsUrl('/news/', true, false)); diff --git a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php index 3d9cd8a5ed..ba68abf8a8 100755 --- a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php +++ b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php @@ -498,6 +498,7 @@ public function testGetCategoryUrl($blogCategoryId, $base, $useBase, $expected) $siteUrl = Configure::read('BcEnv.siteUrl'); Configure::write('BcEnv.siteUrl', 'https://main.com'); + Configure::write('BcEnv.host', 'main.com'); $this->Blog->getView()->setRequest($this->getRequest('/', [], 'GET', $base? ['base' => $base] : [])); $options = [ 'base' => $useBase