Skip to content

Commit

Permalink
Merge pull request #10648 from creative-commoners/pulls/4/deprecate-h…
Browse files Browse the repository at this point in the history
…tml5

API Deprecate HTML4Value
  • Loading branch information
Maxime Rainville authored Jan 17, 2023
2 parents 2c105cf + b973c88 commit c430011
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/View/Parsers/HTML4Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/php/View/Parsers/HTML4ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c430011

Please sign in to comment.