Skip to content

Commit

Permalink
Add tests proving using meta('icon') with theme works as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 17, 2015
1 parent ab14e6d commit e9ffd52
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/TestCase/View/Helper/HtmlHelperTest.php
Expand Up @@ -1671,6 +1671,38 @@ public function testMetaIcon()
$this->assertHtml($expected, $result);
}

/**
* Test generating favicon's with meta() with theme
*
* @return void
*/
public function testMetaIconWithTheme()
{
$this->Html->Url->theme = 'TestTheme';

$result = $this->Html->meta('icon', 'favicon.ico');
$expected = [
'link' => ['href' => 'preg:/.*test_theme\/favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'icon'],
['link' => ['href' => 'preg:/.*test_theme\/favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'shortcut icon']]
];
$this->assertHtml($expected, $result);

$result = $this->Html->meta('icon');
$expected = [
'link' => ['href' => 'preg:/.*test_theme\/favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'icon'],
['link' => ['href' => 'preg:/.*test_theme\/favicon\.ico/', 'type' => 'image/x-icon', 'rel' => 'shortcut icon']]
];
$this->assertHtml($expected, $result);

$this->Html->request->webroot = '/testing/';
$result = $this->Html->meta('icon');
$expected = [
'link' => ['href' => '/testing/test_theme/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'icon'],
['link' => ['href' => '/testing/test_theme/favicon.ico', 'type' => 'image/x-icon', 'rel' => 'shortcut icon']]
];
$this->assertHtml($expected, $result);
}

/**
* Test the inline and block options for meta()
*
Expand Down
Binary file not shown.

0 comments on commit e9ffd52

Please sign in to comment.