Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webbasics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
webbasics
Commits
852e39ea
Commit
852e39ea
authored
Jul 21, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed carrot return comparison issue in unit tests.
parent
4e8d9e32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
tests/test_template.php
tests/test_template.php
+7
-2
No files found.
tests/test_template.php
View file @
852e39ea
...
...
@@ -109,9 +109,13 @@ class TemplateTest extends PHPUnit_Framework_TestCase {
return
$rp
->
getValue
(
$object
);
}
static
function
strip_newlines
(
$html
)
{
return
str_replace
(
"
\r\n
"
,
"
\n
"
,
$html
);
}
function
assert_is_html_node
(
$node
,
$content
)
{
$this
->
assertEquals
(
'html'
,
$node
->
get_name
());
$this
->
assertEquals
(
$content
,
s
tr_replace
(
"
\r\n
"
,
"
\n
"
,
$node
->
get
(
'content'
)));
$this
->
assertEquals
(
$content
,
s
elf
::
strip_newlines
(
$node
->
get
(
'content'
)));
$this
->
assertEquals
(
array
(),
$node
->
get_children
());
}
...
...
@@ -358,7 +362,8 @@ class TemplateTest extends PHPUnit_Framework_TestCase {
function
assert_renders
(
$expected_file
,
$tpl
)
{
$expected_file
=
"tests/_files/rendered/
$expected_file
.html"
;
$this
->
assertStringEqualsFile
(
$expected_file
,
$tpl
->
render
());
$this
->
assertEquals
(
self
::
strip_newlines
(
file_get_contents
(
$expected_file
)),
self
::
strip_newlines
(
$tpl
->
render
()));
}
function
test_render_simple
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment