You are here

public function SafeMarkupTest::testIsSafe in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php \Drupal\Tests\Component\Utility\SafeMarkupTest::testIsSafe()

Tests SafeMarkup::isSafe() with different objects.

@covers ::isSafe

File

core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php, line 53
Contains \Drupal\Tests\Component\Utility\SafeMarkupTest.

Class

SafeMarkupTest
Tests marking strings as safe.

Namespace

Drupal\Tests\Component\Utility

Code

public function testIsSafe() {
  $safe_string = $this
    ->getMock('\\Drupal\\Component\\Render\\MarkupInterface');
  $this
    ->assertTrue(SafeMarkup::isSafe($safe_string));
  $string_object = new SafeMarkupTestString('test');
  $this
    ->assertFalse(SafeMarkup::isSafe($string_object));
}