Skip to content

Commit

Permalink
MNT Make data providers static
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 14, 2025
1 parent 9b61628 commit 227bb5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/php/Core/XssSanitiserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class XssSanitiserTest extends SapphireTest
{
protected $usesDatabase = false;

public function provideSanitise(): array
public static function provideSanitise(): array
{
// Most of these scenarios are inspired by Symfony's HtmlSanitizerAllTest scenarios
return [
Expand Down Expand Up @@ -341,7 +341,7 @@ public function testSanitiseElement(string $input, string $expected): void
$this->assertSame($expected, $htmlValue->getContent());
}

public function provideSanitiseElementsAllowed(): array
public static function provideSanitiseElementsAllowed(): array
{
return [
'disallow these by default' => [
Expand Down Expand Up @@ -374,7 +374,7 @@ public function testSanitiseElementsAllowed(string $input, ?array $removeElement
$this->assertSame($expected, $sanitiser->sanitiseString($input));
}

public function provideSanitiseAttributesAllowed(): array
public static function provideSanitiseAttributesAllowed(): array
{
return [
'disallow these by default' => [
Expand Down Expand Up @@ -425,7 +425,7 @@ public function testSanitiseAttributesAllowed(string $input, ?array $removeAttri
$this->assertSame($expected, $sanitiser->sanitiseString($input));
}

public function provideSanitiseNoKeepInnerHtml(): array
public static function provideSanitiseNoKeepInnerHtml(): array
{
return [
'keeps inner html' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Forms/FormMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
use SilverStripe\Core\XssSanitiser;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\Tests\FormMessageTest\TestFormMessage;
use SilverStripe\ORM\ValidationResult;
use SilverStripe\Core\Validation\ValidationResult;

class FormMessageTest extends SapphireTest
{
protected $usesDatabase = false;

public function provideGetMessage(): array
public static function provideGetMessage(): array
{
return [
'empty HTML' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/View/Shortcodes/EmbedShortcodeProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function testOnlyWhitelistedAttributesAllowed()
);
}

public function provideSandboxHtml(): array
public static function provideSandboxHtml(): array
{
return [
'normal' => [
Expand Down

0 comments on commit 227bb5e

Please sign in to comment.