You are here

public function FaviconTestCase::assertFavicon in Favicon 7

Assert that the favicon is as expected

Parameters

string $path: The expected full path to the favicon file.

string $message: A test message to display.

Return value

bool

2 calls to FaviconTestCase::assertFavicon()
FaviconTestCase::testGetFaviconFile in ./favicon.test
Check favicon.ico returns the default favicon if no shortcut icon is specified.
FaviconTestCase::testPassForGoodMimeType in ./favicon.test
Check that the correct favicon.ico details are returned if a valid shortcut icon is specified.

File

./favicon.test, line 81
Tests for Favicon

Class

FaviconTestCase
@file Tests for Favicon

Code

public function assertFavicon($path, $message = '') {
  $file_details = _favicon_get_favicon_file();
  $this
    ->assertEqual($file_details['path'], $path, 'Favicon path is as expected.' . $message);
  $allowed_favicon_types = array(
    'image/x-icon',
    'image/vnd.microsoft.icon',
  );
  return $this
    ->assert(in_array($file_details['mime'], $allowed_favicon_types), t('Mime type of the favicon is as expected. ' . $message));
}