Skip to content

Commit

Permalink
fix: disable setBaseURL() method
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 18, 2023
1 parent 032e3bb commit 0c70b04
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions system/HTTP/SiteURI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
10 changes: 10 additions & 0 deletions tests/system/HTTP/SiteURITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0c70b04

Please sign in to comment.