You are here

public function FaviconTestBase::assertFavicon in Favicon 7.2

1 call to FaviconTestBase::assertFavicon()
FaviconSecurityTestCase::testFaviconSecurity in tests/FaviconSecurityTestCase.test
Test that the favicon is not allowed to be set to an insecure file.

File

tests/FaviconTestBase.test, line 24

Class

FaviconTestBase

Code

public function assertFavicon($expected, $theme = NULL, $cache = TRUE) {
  try {
    $favicon = DrupalFavicon::fetchFile($theme, $cache);
    $this
      ->assertIdentical($favicon->uri, $expected, 'DrupalFavicon::getFile(' . var_export($theme, TRUE) . ', ' . var_export($cache, TRUE) . ') returned ' . var_export($favicon, TRUE) . ', expected ' . var_export($expected, TRUE) . '.');
  } catch (DrupalFaviconValidationException $e) {
    $this
      ->assertFalse($expected, 'DrupalFavicon::getFile(' . var_export($theme, TRUE) . ', ' . var_export($cache, TRUE) . ') threw DrupalFaviconValidationException.');
  }
}