Permalink
Browse files

T475: Added line breaks to Tag:javascriptInclude/stylesheetLink

	modified:   build/64bits/phalcon.c
	modified:   build/safe/phalcon.c
	modified:   ext/tag.c
	modified:   php-tests/tests/Phalcon/Tag/UnitTest.php
  • Loading branch information...
1 parent af0cb04 commit fe4e3378a342bacc29ce760d1cc5c1c1dc6fb4db @niden niden committed Mar 15, 2013
Showing with 117,739 additions and 117,706 deletions.
  1. +59,887 −59,878 build/64bits/phalcon.c
  2. +57,795 −57,786 build/safe/phalcon.c
  3. +19 −4 ext/tag.c
  4. +38 −38 php-tests/tests/Phalcon/Tag/UnitTest.php
View
119,765 build/64bits/phalcon.c
59,887 additions, 59,878 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
115,581 build/safe/phalcon.c
57,795 additions, 57,786 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
23 ext/tag.c
@@ -1300,7 +1300,7 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink){
zval *parameters = NULL, *local = NULL, *params = NULL, *first_param;
zval *url, *url_href, *href, *code, *value = NULL, *key = NULL, *five;
- zval *doctype, *is_xhtml;
+ zval *doctype, *is_xhtml, *eol;
HashTable *ah0;
HashPosition hp0;
zval **hd;
@@ -1404,8 +1404,15 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink){
} else {
phalcon_concat_self_str(&code, SL(">") TSRMLS_CC);
}
-
-
+
+ /**
+ * Add the EOL character at the end
+ */
+ PHALCON_INIT_VAR(eol);
+ zend_get_constant(SL("PHP_EOL"), eol TSRMLS_CC);
+
+ phalcon_concat_self(&code, eol TSRMLS_CC);
+
RETURN_CTOR(code);
}
@@ -1430,7 +1437,7 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink){
PHP_METHOD(Phalcon_Tag, javascriptInclude){
zval *parameters = NULL, *local = NULL, *params = NULL, *first_param;
- zval *url, *params_src, *src, *code, *value = NULL, *key = NULL;
+ zval *url, *params_src, *src, *code, *value = NULL, *key = NULL, *eol;
HashTable *ah0;
HashPosition hp0;
zval **hd;
@@ -1523,6 +1530,14 @@ PHP_METHOD(Phalcon_Tag, javascriptInclude){
phalcon_concat_self_str(&code, SL("></script>") TSRMLS_CC);
+ /**
+ * Add the EOL character at the end
+ */
+ PHALCON_INIT_VAR(eol);
+ zend_get_constant(SL("PHP_EOL"), eol TSRMLS_CC);
+
+ phalcon_concat_self(&code, eol TSRMLS_CC);
+
RETURN_CTOR(code);
}
View
76 php-tests/tests/Phalcon/Tag/UnitTest.php
@@ -206,7 +206,7 @@ public function testStylesheetLinkLocal()
{
$options = 'css/phalcon.css';
$expected = '<link rel="stylesheet" href="/css/phalcon.css" '
- . 'type="text/css">';
+ . 'type="text/css">' . PHP_EOL;
$actual = PhTag::stylesheetLink($options);
$this->assertEquals(
@@ -226,7 +226,7 @@ public function testStylesheetLinkWithArrayLocal()
{
$options = array('css/phalcon.css');
$expected = '<link rel="stylesheet" href="css/phalcon.css" '
- . 'type="text/css">';
+ . 'type="text/css">' . PHP_EOL;
$actual = PhTag::stylesheetLink($options);
$this->assertEquals(
@@ -246,7 +246,7 @@ public function testStylesheetLinkWithStringAsSecondParameterLocal()
{
$options = array('css/phalcon.css');
$expected = '<link rel="stylesheet" href="css/phalcon.css" '
- . 'type="text/css">';
+ . 'type="text/css">' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, 'hello');
$this->assertEquals(
@@ -270,8 +270,8 @@ public function testStylesheetLinkRemote()
$options = 'http://fonts.googleapis.com/css?family=Rosario';
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css">';
- $actual = PhTag::stylesheetLink($options, FALSE);
+ . 'type="text/css">' . PHP_EOL;
+ $actual = PhTag::stylesheetLink($options, false);
$this->assertEquals(
$expected,
@@ -291,8 +291,8 @@ public function testStylesheetLinkWithArrayRemote()
$options = array('http://fonts.googleapis.com/css?family=Rosario');
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css">';
- $actual = PhTag::stylesheetLink($options, FALSE);
+ . 'type="text/css">' . PHP_EOL;
+ $actual = PhTag::stylesheetLink($options, false);
$this->assertEquals(
$expected,
@@ -312,7 +312,7 @@ public function testStylesheetLinkWithStringAsSecondParameterRemote()
$options = 'http://fonts.googleapis.com/css?family=Rosario';
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css">';
+ . 'type="text/css">' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, '0');
$this->assertEquals(
@@ -336,7 +336,7 @@ public function testStylesheetLinkLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'css/phalcon.css';
$expected = '<link rel="stylesheet" href="/css/phalcon.css" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options);
PhTag::setDoctype('');
@@ -358,7 +358,7 @@ public function testStylesheetLinkWithArrayLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = array('css/phalcon.css');
$expected = '<link rel="stylesheet" href="css/phalcon.css" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options);
$this->assertEquals(
@@ -379,7 +379,7 @@ public function testStylesheetLinkWithStringAsSecondParameterLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = array('css/phalcon.css');
$expected = '<link rel="stylesheet" href="css/phalcon.css" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, 'hello');
$this->assertEquals(
@@ -404,7 +404,7 @@ public function testStylesheetLinkRemoteXHTML()
$options = 'http://fonts.googleapis.com/css?family=Rosario';
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, FALSE);
$this->assertEquals(
@@ -426,7 +426,7 @@ public function testStylesheetLinkWithArrayRemoteXHTML()
$options = array('http://fonts.googleapis.com/css?family=Rosario');
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, FALSE);
$this->assertEquals(
@@ -448,7 +448,7 @@ public function testStylesheetLinkWithStringAsSecondParameterRemoteXHTML()
$options = 'http://fonts.googleapis.com/css?family=Rosario';
$expected = '<link rel="stylesheet" '
. 'href="http://fonts.googleapis.com/css?family=Rosario" '
- . 'type="text/css" />';
+ . 'type="text/css" />' . PHP_EOL;
$actual = PhTag::stylesheetLink($options, '0');
$this->assertEquals(
@@ -474,7 +474,7 @@ public function testJavascriptIncludeLocal()
{
$options = 'js/phalcon.js';
$expected = '<script src="/js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options);
$this->assertEquals(
@@ -494,7 +494,7 @@ public function testJavascriptIncludeWithArrayLocal()
{
$options = array('js/phalcon.js');
$expected = '<script src="js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options);
$this->assertEquals(
@@ -514,15 +514,15 @@ public function testJavascriptIncludeWithStringAsSecondParameterLocal()
{
$options = 'js/phalcon.js';
$expected = '<script src="/js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options, 'hello');
$this->assertEquals(
$expected,
$actual,
sprintf(
- $this->message, '
- JavascriptInclude local with string as second parameter'
+ $this->message,
+ 'JavascriptInclude local with string as second parameter'
)
);
}
@@ -537,8 +537,8 @@ public function testJavascriptIncludeRemote()
{
$options = 'http://my.local.com/js/phalcon.js';
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
- $actual = PhTag::javascriptInclude($options, FALSE);
+ . 'type="text/javascript"></script>' . PHP_EOL;
+ $actual = PhTag::javascriptInclude($options, false);
$this->assertEquals(
$expected,
@@ -557,8 +557,8 @@ public function testJavascriptIncludeWithArrayRemote()
{
$options = array('http://my.local.com/js/phalcon.js');
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
- $actual = PhTag::javascriptInclude($options, FALSE);
+ . 'type="text/javascript"></script>' . PHP_EOL;
+ $actual = PhTag::javascriptInclude($options, false);
$this->assertEquals(
$expected,
@@ -577,7 +577,7 @@ public function testJavascriptIncludeWithStringAsSecondParameterRemote()
{
$options = 'http://my.local.com/js/phalcon.js';
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
+ . 'type="text/javascript"></script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options, '0');
$this->assertEquals(
@@ -601,7 +601,7 @@ public function testJavascriptIncludeLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'js/phalcon.js';
$expected = '<script src="/js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options);
PhTag::setDoctype('');
@@ -623,7 +623,7 @@ public function testJavascriptIncludeWithArrayLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = array('js/phalcon.js');
$expected = '<script src="js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options);
PhTag::setDoctype('');
@@ -645,16 +645,16 @@ public function testJavascriptIncludeWithStringAsSecondParameterLocalXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'js/phalcon.js';
$expected = '<script src="/js/phalcon.js" type="text/javascript">'
- . '</script>';
+ . '</script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options, 'hello');
PhTag::setDoctype('');
$this->assertEquals(
$expected,
$actual,
sprintf(
- $this->message, 'xhtml
- JavascriptInclude local with string as second parameter'
+ $this->message,
+ 'xhtml JavascriptInclude local with string as second parameter'
)
);
}
@@ -670,8 +670,8 @@ public function testJavascriptIncludeRemoteXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'http://my.local.com/js/phalcon.js';
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
- $actual = PhTag::javascriptInclude($options, FALSE);
+ . 'type="text/javascript"></script>' . PHP_EOL;
+ $actual = PhTag::javascriptInclude($options, false);
PhTag::setDoctype('');
$this->assertEquals(
@@ -692,8 +692,8 @@ public function testJavascriptIncludeWithArrayRemoteXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = array('http://my.local.com/js/phalcon.js');
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
- $actual = PhTag::javascriptInclude($options, FALSE);
+ . 'type="text/javascript"></script>' . PHP_EOL;
+ $actual = PhTag::javascriptInclude($options, false);
PhTag::setDoctype('');
$this->assertEquals(
@@ -714,7 +714,7 @@ public function testJavascriptIncludeWithStringAsSecondParameterRemoteXHTML()
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'http://my.local.com/js/phalcon.js';
$expected = '<script src="http://my.local.com/js/phalcon.js" '
- . 'type="text/javascript"></script>';
+ . 'type="text/javascript"></script>' . PHP_EOL;
$actual = PhTag::javascriptInclude($options, '0');
PhTag::setDoctype('');
@@ -738,7 +738,7 @@ public function testJavascriptIncludeWithStringAsSecondParameterRemoteXHTML()
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-11-29
*/
- public function testResetInputSetDefault_T53()
+ public function testResetInputSetDefaultT53()
{
$options = 'some_field_name';
$expected = '<input type="text" name="some_field_name" '
@@ -770,7 +770,7 @@ public function testResetInputSetDefault_T53()
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-11-29
*/
- public function testResetInputDisplayTo_T53()
+ public function testResetInputDisplayToT53()
{
$options = 'some_field_name';
$expected = '<input type="text" name="some_field_name" '
@@ -802,7 +802,7 @@ public function testResetInputDisplayTo_T53()
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-10-26
*/
- public function testResetInputSetDefaultXHTML_T53()
+ public function testResetInputSetDefaultXHTMLT53()
{
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'some_field_name';
@@ -836,7 +836,7 @@ public function testResetInputSetDefaultXHTML_T53()
* @author Nikos Dimopoulos <nikos@phalconphp.com>
* @since 2012-10-26
*/
- public function testResetInputDisplayToXHTML_T53()
+ public function testResetInputDisplayToXHTMLT53()
{
PhTag::setDoctype(PhTag::XHTML10_STRICT);
$options = 'some_field_name';

0 comments on commit fe4e337

Please sign in to comment.