Permalink
Browse files

Split existing tests up, and add tests for Router based image URL's

Refs #2233
  • Loading branch information...
markstory committed Nov 9, 2013
1 parent ada0ec4 commit bf2f2e772e89265fb4aa3e06e7261cfd5c45abdf
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -416,10 +416,32 @@ public function testImageTag() {
$result = $this->Html->image('/test/view/1.gif');
$this->assertTags($result, array('img' => array('src' => '/test/view/1.gif', 'alt' => '')));
}
/**
* Test image() with query strings.
*
* @return void
*/
public function testImageQueryString() {
$result = $this->Html->image('test.gif?one=two&three=four');
$this->assertTags($result, array('img' => array('src' => 'img/test.gif?one=two&three=four', 'alt' => '')));
$result = $this->Html->image(array(
'controller' => 'images',
'action' => 'display',
'test',
'?' => array('one' => 'two', 'three' => 'four')
));
$this->assertTags($result, array('img' => array('src' => '/images/display/test?one=two&three=four', 'alt' => '')));
}
/**
* Test that image works with pathPrefix.
*
* @return void
*/
public function testImagePathPrefix() {
$result = $this->Html->image('test.gif', array('pathPrefix' => '/my/custom/path/'));
$this->assertTags($result, array('img' => array('src' => '/my/custom/path/test.gif', 'alt' => '')));

0 comments on commit bf2f2e7

Please sign in to comment.