Merge pull request #10648 from creative-commoners/pulls/4/deprecate-html5

API Deprecate HTML4Value
This commit is contained in:
Maxime Rainville 2023-01-17 22:20:07 +13:00 committed by GitHub
commit c430011f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -2,8 +2,24 @@
namespace SilverStripe\View\Parsers;
use SilverStripe\Dev\Deprecation;
/*
* @deprecated 4.13.0 Will be removed without equivalent functionality to replace it
*/
class HTML4Value extends HTMLValue
{
public function __construct($fragment = null)
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'4.13.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct($fragment);
}
/**
* @param string $content

View File

@ -2,11 +2,20 @@
namespace SilverStripe\View\Tests\Parsers;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\View\Parsers\HTML4Value;
class HTML4ValueTest extends SapphireTest
{
protected function setUp(): void
{
parent::setUp();
if (Deprecation::isEnabled()) {
$this->markTestSkipped('Test calls deprecated code');
}
}
public function testInvalidHTMLSaving()
{
$value = new HTML4Value();