-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Inconsistency in Tag::stylesheetLink/javascriptInclude - local links #1486
Comments
The default local value has question. Tag::stylesheetLink(array('css/phalcon.css', true)) |
@dreamsxin I seem to have a problem still with this one. This is what I am calling: Tag::stylesheetLink('css/phalcon.css') and I get -'<link rel="stylesheet" href="css/phalcon.css" type="text/css" />
+'<link rel="stylesheet" href="/css/phalcon.css" type="text/css" /> (expected/actual) The call: Tag::stylesheetLink(array('css/phalcon.css')) works just fine. This also happens when I call javascriptInclude When you get a chance could you be so kind and look at it? Thanks! |
I am testing this in 1.2.5 |
Can you pass the test? I can't find the problem. phpunit unit-tests/TagTest.php |
Sadly it fails ndimopoulos@ARGON:~/Applications/niden-cphalcon (Codeception u=) $ phpunit unit-tests/TagTest.php
PHPUnit 3.7.27 by Sebastian Bergmann.
..F
Time: 463 ms, Memory: 3.00Mb
There was 1 failure:
1) TagTest::testIssue1486
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" href="css/phalcon.css" type="text/css" />
+'<link rel="stylesheet" href="/css/phalcon.css" type="text/css" />
'
/home/ndimopoulos/Applications/niden-cphalcon/unit-tests/TagTest.php:114
FAILURES!
Tests: 3, Assertions: 11, Failures: 1. Note that the parameters are reversed - the top one is the actual and the bottom the expected |
Hmmm odd. It passes in the phalcon/cphalcon repo but not in my fork.... Let me check this a bit more |
Ok, I just in 1.2.5 test pass. |
I had to regenerate the build files - strange. I now have another issue with the remote: Tag::stylesheetLink(array('<link rel="stylesheet" href="/css/phalcon.css" type="text/css">')); produces -'<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Rosario" type="text/css">
+'<link rel="stylesheet" href="/http://fonts.googleapis.com/css?family=Rosario" type="text/css"> using Tag::stylesheetLink('<link rel="stylesheet" href="/css/phalcon.css" type="text/css">'); works fine |
Same thing with the javascriptInclude. If you want to see the tests I am running you can clone my fork and check the Codeception branch. You can run the tests using cd tests My forked repo is here: |
OK, Let me try. |
$localCssOutput = '<link rel="stylesheet" '
. 'href="css/phalcon.css" type="text/css"'; Should $localCssOutput = '<link rel="stylesheet" '
. 'href="/css/phalcon.css" type="text/css"'; And this, if param is array, the second parameter is invalid Tag::javascriptInclude(array($this->remoteJsSource, ), false) should Tag::javascriptInclude(array($this->remoteJsSource, false)) |
That works. We need to change the docs a bit to state that if you pass an array then all params should be in the array Thanks for all the help :) |
Not at all. You're welcome. |
There is a minor inconsistency when creating stylesheet links or javascript includes, depending on how you pass your parameters.
produces
If you use
it produces
Note the / in the href
The text was updated successfully, but these errors were encountered: