Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
5b6806a0
Commit
5b6806a0
authored
May 04, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed tests broken because of moved files
git-svn-id:
svn://dwoo.org/dwoo/trunk@36
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
418fa1a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
CoreTests.php
tests/CoreTests.php
+4
-4
DwooTests.php
tests/DwooTests.php
+2
-1
FuncTests.php
tests/FuncTests.php
+4
-4
SmartyTests.php
tests/SmartyTests.php
+4
-4
No files found.
tests/CoreTests.php
View file @
5b6806a0
...
...
@@ -118,7 +118,7 @@ class CoreTests extends PHPUnit_Framework_TestCase
public
function
testDwoo_GetFilename
()
{
$this
->
assertEquals
(
'44BAR'
,
$this
->
dwoo
->
get
(
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'resources'
.
DIRECTORY_SEPARATOR
.
'
test.html'
,
array
(
'foo'
=>
44
,
'bar'
=>
'BAR'
)));
$this
->
assertEquals
(
'44BAR'
,
$this
->
dwoo
->
get
(
TEST_DIRECTORY
.
'/resources/
test.html'
,
array
(
'foo'
=>
44
,
'bar'
=>
'BAR'
)));
}
public
function
testAssignVarInScope
()
...
...
@@ -189,21 +189,21 @@ class CoreTests extends PHPUnit_Framework_TestCase
public
function
testAddAndRemoveResource
()
{
$this
->
dwoo
->
addResource
(
'news'
,
'Dwoo_Template_File'
,
array
(
'Dwoo_Compiler'
,
'compilerFactory'
));
$tpl
=
new
Dwoo_Template_String
(
'{include file="news:'
.
DWOO_DIRECTORY
.
'tests
/resources/test.html" foo=3 bar=4}'
);
$tpl
=
new
Dwoo_Template_String
(
'{include file="news:'
.
TEST_DIRECTORY
.
'
/resources/test.html" foo=3 bar=4}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"34"
,
$this
->
dwoo
->
get
(
$tpl
,
array
()));
$this
->
dwoo
->
removeResource
(
'news'
);
$this
->
dwoo
->
addResource
(
'file'
,
'Dwoo_Template_String'
,
'Fake'
);
$this
->
dwoo
->
removeResource
(
'file'
);
$tpl
=
new
Dwoo_Template_String
(
'{include file="file:'
.
DWOO_DIRECTORY
.
'tests
/resources/test.html" foo=3 bar=4}'
);
$tpl
=
new
Dwoo_Template_String
(
'{include file="file:'
.
TEST_DIRECTORY
.
'
/resources/test.html" foo=3 bar=4}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"34"
,
$this
->
dwoo
->
get
(
$tpl
,
array
()));
}
public
function
testTemplateFile
()
{
$tpl
=
new
Dwoo_Template_File
(
DWOO_DIRECTORY
.
'tests
/resources/test.html'
);
$tpl
=
new
Dwoo_Template_File
(
TEST_DIRECTORY
.
'
/resources/test.html'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"12"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'foo'
=>
1
,
'bar'
=>
2
)));
...
...
tests/DwooTests.php
View file @
5b6806a0
...
...
@@ -5,7 +5,8 @@ if(!ini_get('date.timezone'))
date_default_timezone_set
(
'CET'
);
define
(
'DWOO_CACHE_DIRECTORY'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'cache'
);
define
(
'DWOO_COMPILE_DIRECTORY'
,
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'temp'
.
DIRECTORY_SEPARATOR
.
'compiled'
);
require
dirname
(
dirname
(
__FILE__
))
.
DIRECTORY_SEPARATOR
.
'Dwoo.php'
;
require
dirname
(
dirname
(
__FILE__
))
.
DIRECTORY_SEPARATOR
.
'lib'
.
DIRECTORY_SEPARATOR
.
'Dwoo.php'
;
define
(
'TEST_DIRECTORY'
,
dirname
(
__FILE__
));
class
DwooTests
{
public
static
function
suite
()
{
...
...
tests/FuncTests.php
View file @
5b6806a0
...
...
@@ -206,7 +206,7 @@ class FuncTests extends PHPUnit_Framework_TestCase
public
function
testFetch
()
{
$tpl
=
new
Dwoo_Template_String
(
'{fetch file="'
.
DWOO_DIRECTORY
.
'tests
/resources/test.html"}'
);
$tpl
=
new
Dwoo_Template_String
(
'{fetch file="'
.
TEST_DIRECTORY
.
'
/resources/test.html"}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
'{$foo}{$bar}'
,
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
...
...
@@ -214,12 +214,12 @@ class FuncTests extends PHPUnit_Framework_TestCase
public
function
testInclude
()
{
$tpl
=
new
Dwoo_Template_String
(
'{include file=\'file:'
.
DWOO_DIRECTORY
.
'tests
/resources/test.html\' foo=$a bar=$b}'
);
$tpl
=
new
Dwoo_Template_String
(
'{include file=\'file:'
.
TEST_DIRECTORY
.
'
/resources/test.html\' foo=$a bar=$b}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"AB"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'a'
=>
'A'
,
'b'
=>
'B'
)));
$tpl
=
new
Dwoo_Template_String
(
'{include file=\'file:'
.
DWOO_DIRECTORY
.
'tests
/resources/test.html\'}'
);
$tpl
=
new
Dwoo_Template_String
(
'{include file=\'file:'
.
TEST_DIRECTORY
.
'
/resources/test.html\'}'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"ab"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'foo'
=>
'a'
,
'bar'
=>
'b'
),
$this
->
compiler
));
...
...
@@ -229,7 +229,7 @@ class FuncTests extends PHPUnit_Framework_TestCase
$this
->
assertEquals
(
""
,
$this
->
dwoo
->
get
(
$tpl
,
array
(
'foo'
=>
'a'
,
'bar'
=>
'b'
),
$this
->
compiler
));
$tpl
=
new
Dwoo_Template_File
(
DWOO_DIRECTORY
.
'tests
/resources/inctest.html'
);
$tpl
=
new
Dwoo_Template_File
(
TEST_DIRECTORY
.
'
/resources/inctest.html'
);
$tpl
->
forceCompilation
();
$this
->
assertEquals
(
"34"
,
$this
->
dwoo
->
get
(
$tpl
,
array
(),
$this
->
compiler
));
...
...
tests/SmartyTests.php
View file @
5b6806a0
...
...
@@ -11,10 +11,10 @@ class SmartyTests extends PHPUnit_Framework_TestCase
{
// extend this class and override this in your constructor to test a modded compiler
$this
->
dwoo
=
new
Dwoo_Smarty_Adapter
();
$this
->
dwoo
->
template_dir
=
DWOO_DIRECTORY
.
'tests
/resources/'
;
$this
->
dwoo
->
compile_dir
=
DWOO_DIRECTORY
.
'tests
/temp/compiled/'
;
$this
->
dwoo
->
cache_dir
=
DWOO_DIRECTORY
.
'tests
/temp/cache/'
;
$this
->
dwoo
->
config_dir
=
DWOO_DIRECTORY
.
'tests
/resources/configs/'
;
$this
->
dwoo
->
template_dir
=
TEST_DIRECTORY
.
'
/resources/'
;
$this
->
dwoo
->
compile_dir
=
TEST_DIRECTORY
.
'
/temp/compiled/'
;
$this
->
dwoo
->
cache_dir
=
TEST_DIRECTORY
.
'
/temp/cache/'
;
$this
->
dwoo
->
config_dir
=
TEST_DIRECTORY
.
'
/resources/configs/'
;
$this
->
compiler
=
new
Dwoo_Compiler
();
$this
->
compiler
->
addPreProcessor
(
'smarty_compat'
,
true
);
}
...
...
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