Skip to content

Commit

Permalink
コード整理
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Oct 6, 2024
1 parent 58991f8 commit c41c2e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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'],
Expand Down
1 change: 0 additions & 1 deletion plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(), 'ホストを変更できません。');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c41c2e9

Please sign in to comment.