Skip to content

Commit

Permalink
Merge pull request #1492 from dreamsxin/bug_1486_1.3.0
Browse files Browse the repository at this point in the history
Fix #1486 for v1.3.0
  • Loading branch information
niden committed Oct 31, 2013
2 parents 899da2a + 9e3bf7f commit 5c9c64b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink){
}
else {
PHALCON_INIT_VAR(z_local);
ZVAL_FALSE(z_local);
ZVAL_TRUE(z_local);
}

if (!phalcon_array_isset_string(params, SS("type"))) {
Expand Down Expand Up @@ -1635,7 +1635,7 @@ PHP_METHOD(Phalcon_Tag, javascriptInclude){
phalcon_array_unset_string(&params, SS("local"), PH_SEPARATE);
} else {
PHALCON_INIT_VAR(z_local);
ZVAL_FALSE(z_local);
ZVAL_TRUE(z_local);
}

if (!phalcon_array_isset_string(params, SS("type"))) {
Expand Down
19 changes: 19 additions & 0 deletions unit-tests/TagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,23 @@ public function testSetTitleSeparator()

$this->assertEquals(Tag::getTitle(), '<title>Class|Title</title>'.PHP_EOL);
}

public function testIssue1486()
{
$di = new Phalcon\DI\FactoryDefault();
$di->getshared('url')->setBaseUri('/');
\Phalcon\Tag::setDI($di);

$html = \Phalcon\Tag::stylesheetLink('css/phalcon.css');
$this->assertEquals($html, '<link rel="stylesheet" href="/css/phalcon.css" type="text/css" />'.PHP_EOL);

$html = \Phalcon\Tag::stylesheetLink(array('css/phalcon.css'));
$this->assertEquals($html, '<link rel="stylesheet" href="/css/phalcon.css" type="text/css" />'.PHP_EOL);

$html = \Phalcon\Tag::javascriptInclude('js/phalcon.js');
$this->assertEquals($html, '<script src="/js/phalcon.js" type="text/javascript"></script>'.PHP_EOL);

$html = \Phalcon\Tag::javascriptInclude(array('js/phalcon.js'));
$this->assertEquals($html, '<script src="/js/phalcon.js" type="text/javascript"></script>'.PHP_EOL);
}
}

0 comments on commit 5c9c64b

Please sign in to comment.