Skip to content
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

[1.3.0] Tests are broken again :-( #1960

Closed
ghost opened this issue Feb 2, 2014 · 5 comments
Closed

[1.3.0] Tests are broken again :-( #1960

ghost opened this issue Feb 2, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 2, 2014

There were 10 failures:

1) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayLocal
StylesheetLink local with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="css/phalcon.css">
+'<link rel="stylesheet" type="text/css" href="/css/phalcon.css">
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:234
/usr/bin/phpunit:46

2) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithStringAsSecondParameterLocal
StylesheetLink local with string as second parameter does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="css/phalcon.css">
+'<link rel="stylesheet" type="text/css" href="/css/phalcon.css">
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:256
/usr/bin/phpunit:46

3) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayRemote
StylesheetLink remote with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Rosario">
+'<link rel="stylesheet" type="text/css" href="/http://fonts.googleapis.com/css?family=Rosario">
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:294
/usr/bin/phpunit:46

4) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayLocalXHTML
XHTML StylesheetLink local with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="css/phalcon.css" />
+'<link rel="stylesheet" type="text/css" href="/css/phalcon.css" />
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:357
/usr/bin/phpunit:46

5) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithStringAsSecondParameterLocalXHTML
StylesheetLink local with string as second parameter does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="css/phalcon.css" />
+'<link rel="stylesheet" type="text/css" href="/css/phalcon.css" />
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:380
/usr/bin/phpunit:46

6) Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayRemoteXHTML
XHTML StylesheetLink remote with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Rosario" />
+'<link rel="stylesheet" type="text/css" href="/http://fonts.googleapis.com/css?family=Rosario" />
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:420
/usr/bin/phpunit:46

7) Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayLocal
JavascriptInclude local with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<script type="text/javascript" src="js/phalcon.js"></script>
+'<script type="text/javascript" src="/js/phalcon.js"></script>
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:484
/usr/bin/phpunit:46

8) Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayRemote
JavascriptInclude remote with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<script type="text/javascript" src="http://my.local.com/js/phalcon.js"></script>
+'<script type="text/javascript" src="/http://my.local.com/js/phalcon.js"></script>
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:544
/usr/bin/phpunit:46

9) Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayLocalXHTML
XHTML JavascriptInclude local with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<script type="text/javascript" src="js/phalcon.js"></script>
+'<script type="text/javascript" src="/js/phalcon.js"></script>
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:608
/usr/bin/phpunit:46

10) Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayRemoteXHTML
XHTML JavascriptInclude remote with Array does not return proper html element
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<script type="text/javascript" src="http://my.local.com/js/phalcon.js"></script>
+'<script type="text/javascript" src="/http://my.local.com/js/phalcon.js"></script>
 '

/php-tests/tests/Phalcon/Tag/UnitTest.php:674
/usr/bin/phpunit:46
@ghost
Copy link
Author

ghost commented Feb 2, 2014

  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayLocal (b092106)
  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithStringAsSecondParameterLocal (b092106)
  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayRemote (8aa0f8b)
  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayLocalXHTML (b092106)
  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithStringAsSecondParameterLocalXHTML (b092106)
  • Phalcon\Test\Tag\UnitTest::testStylesheetLinkWithArrayRemoteXHTML (8aa0f8b)
  • Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayLocal (b092106)
  • Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayRemote (8aa0f8b)
  • Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayLocalXHTML (b092106)
  • Phalcon\Test\Tag\UnitTest::testJavascriptIncludeWithArrayRemoteXHTML (8aa0f8b)

@ghost
Copy link
Author

ghost commented Feb 2, 2014

Worked in 899da2a
Broke in 5c9c64b
Diff: 899da2a...5c9c64b

Related: #1486

@niden Could you please take a look?

@ghost
Copy link
Author

ghost commented Feb 2, 2014

Looks like 1.2.5/6 behave the same way now and if the URL is local, this should be mentioned explicitly.

@niden
Copy link
Member

niden commented Feb 2, 2014

This "should" work the same way in 1.3.0. Do we need to change the Tag? If
so I can investigate it more or adjust the tests.

In your example above I saw that there is an error for remote URLs (see it
prepends it with / before the http).

The contents of this message may contain confidential or privileged
information and is intended solely for the recipient(s). Use or
distribution to and by any other party is not authorized. If you are not
the intended recipient, copying, distribution or use of the contents of
this information is prohibited.

On Sun, Feb 2, 2014 at 12:26 AM, Vladimir Kolesnikov <
notifications@github.com> wrote:

Looks like 1.2.5/6 behave the same way now and if the URL is local, this
should be mentioned explicitly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1960#issuecomment-33892771
.

@ghost
Copy link
Author

ghost commented Feb 2, 2014

Well… I think the test needs to be updated:

    public function testStylesheetLinkWithArrayLocal()
    {
        $options  = array('css/phalcon.css');
-       $expected = '<link rel="stylesheet" type="text/css" href="css/phalcon.css">' . PHP_EOL;
+       $expected = '<link rel="stylesheet" type="text/css" href="/css/phalcon.css">' . PHP_EOL;
        $actual   = \Phalcon\Tag::stylesheetLink($options);

        $this->assertEquals(
            $expected,
            $actual,
            sprintf($this->message, 'StylesheetLink local with Array')
        );
    }

In 5c9c64b the URLs became local unless explicitly stated otherwise; local URLs are subject to prepending the base URL. The base URL is set to '/', thus all local URLs will have '/' prepended.

@ghost ghost closed this as completed Feb 25, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant