Skip to content

Commit 0c70b04

Browse files
committed
fix: disable setBaseURL() method
1 parent 032e3bb commit 0c70b04

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

system/HTTP/SiteURI.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ private function setBasePath(string $baseURL): void
180180
}
181181
}
182182

183+
/**
184+
* @deprecated
185+
*/
186+
public function setBaseURL(string $baseURL): void
187+
{
188+
throw new BadMethodCallException('Cannot use this method.');
189+
}
190+
183191
/**
184192
* @deprecated
185193
*/

tests/system/HTTP/SiteURITest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,16 @@ public function testSetURI()
336336
$uri->setURI('http://another.site.example.jp/');
337337
}
338338

339+
public function testSetBaseURI()
340+
{
341+
$this->expectException(BadMethodCallException::class);
342+
343+
$config = new App();
344+
$uri = new SiteURI($config);
345+
346+
$uri->setBaseURL('http://another.site.example.jp/');
347+
}
348+
339349
public function testGetBaseURL()
340350
{
341351
$config = new App();

0 commit comments

Comments
 (0)