Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
04e4a9ce
Commit
04e4a9ce
authored
Jan 18, 2008
by
jepso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added assertNull() and assertNotNull()
parent
6737c5ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
UnitTestCase.php
tests/DoctrineTest/UnitTestCase.php
+25
-6
No files found.
tests/DoctrineTest/UnitTestCase.php
View file @
04e4a9ce
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
class
UnitTestCase
class
UnitTestCase
{
{
protected
$_passed
=
0
;
protected
$_passed
=
0
;
protected
$_failed
=
0
;
protected
$_failed
=
0
;
protected
$_messages
=
array
();
protected
$_messages
=
array
();
public
function
assertEqual
(
$value
,
$value2
)
public
function
assertEqual
(
$value
,
$value2
)
...
@@ -62,13 +62,32 @@ class UnitTestCase
...
@@ -62,13 +62,32 @@ class UnitTestCase
$this
->
_fail
();
$this
->
_fail
();
}
}
}
}
public
function
pass
()
public
function
assertNull
(
$expr
)
{
if
(
is_null
(
$expr
))
{
$this
->
pass
();
}
else
{
$this
->
fail
();
}
}
public
function
assertNotNull
(
$expr
)
{
if
(
is_null
(
$expr
))
{
$this
->
fail
();
}
else
{
$this
->
pass
();
}
}
public
function
pass
()
{
{
$this
->
_passed
++
;
$this
->
_passed
++
;
}
}
public
function
fail
(
$message
=
""
)
public
function
fail
(
$message
=
""
)
{
{
$this
->
_fail
(
$message
);
$this
->
_fail
(
$message
);
}
}
public
function
_fail
(
$message
=
""
)
public
function
_fail
(
$message
=
""
)
{
{
...
@@ -92,7 +111,7 @@ class UnitTestCase
...
@@ -92,7 +111,7 @@ class UnitTestCase
}
}
$this
->
_failed
++
;
$this
->
_failed
++
;
}
}
public
function
run
(
DoctrineTest_Reporter
$reporter
=
null
,
$filter
=
null
)
public
function
run
(
DoctrineTest_Reporter
$reporter
=
null
,
$filter
=
null
)
{
{
foreach
(
get_class_methods
(
$this
)
as
$method
)
{
foreach
(
get_class_methods
(
$this
)
as
$method
)
{
if
(
substr
(
$method
,
0
,
4
)
===
'test'
)
{
if
(
substr
(
$method
,
0
,
4
)
===
'test'
)
{
...
@@ -102,7 +121,7 @@ class UnitTestCase
...
@@ -102,7 +121,7 @@ class UnitTestCase
}
}
}
}
}
}
public
function
getMessages
()
public
function
getMessages
()
{
{
return
$this
->
_messages
;
return
$this
->
_messages
;
}
}
...
...
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