Skip to content

Commit

Permalink
Split existing tests up, and add tests for Router based image URL's
Browse files Browse the repository at this point in the history
Refs #2233
  • Loading branch information
markstory committed Nov 9, 2013
1 parent ada0ec4 commit bf2f2e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
Expand Up @@ -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' => '')));

Expand Down

0 comments on commit bf2f2e7

Please sign in to comment.