diff --git a/system/HTTP/SiteURI.php b/system/HTTP/SiteURI.php index 84488a307bca..9f5cbb56ba5a 100644 --- a/system/HTTP/SiteURI.php +++ b/system/HTTP/SiteURI.php @@ -180,6 +180,14 @@ private function setBasePath(string $baseURL): void } } + /** + * @deprecated + */ + public function setBaseURL(string $baseURL): void + { + throw new BadMethodCallException('Cannot use this method.'); + } + /** * @deprecated */ diff --git a/tests/system/HTTP/SiteURITest.php b/tests/system/HTTP/SiteURITest.php index 9a8caa3a7d95..578074ef5d6f 100644 --- a/tests/system/HTTP/SiteURITest.php +++ b/tests/system/HTTP/SiteURITest.php @@ -336,6 +336,16 @@ public function testSetURI() $uri->setURI('http://another.site.example.jp/'); } + public function testSetBaseURI() + { + $this->expectException(BadMethodCallException::class); + + $config = new App(); + $uri = new SiteURI($config); + + $uri->setBaseURL('http://another.site.example.jp/'); + } + public function testGetBaseURL() { $config = new App();