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
6628644e
Commit
6628644e
authored
May 29, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
58ec853b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
Test.php
tests/Test.php
+82
-0
No files found.
tests/Test.php
0 → 100644
View file @
6628644e
<?php
class
GroupTest
{
protected
$_testCases
=
array
();
public
function
addTestCase
(
UnitTestCase
$testCase
)
{
$this
->
_testCases
[]
=
$testCase
;
}
public
function
run
(
HtmlReporter
$reporter
)
{
foreach
(
$this
->
_testCases
as
$testCase
)
{
$testCase
->
run
();
}
$reporter
->
setTestCase
(
$this
);
$reporter
->
paintHeader
();
$reporter
->
paintFooter
();
}
public
function
getFailCount
()
{
$fails
=
0
;
foreach
(
$this
->
_testCases
as
$testCase
)
{
$fails
+=
$testCase
->
getFailCount
();
}
return
$fails
;
}
public
function
getTestCaseCount
()
{
return
count
(
$this
->
_testCases
);
}
public
function
getPassCount
()
{
$passes
=
0
;
foreach
(
$this
->
_testCases
as
$testCase
)
{
$passes
+=
$testCase
->
getPassCount
();
}
return
$passes
;
}
}
class
HtmlReporter
{
protected
$_test
;
public
function
setTestCase
(
GroupTest
$test
)
{
$this
->
_test
=
$test
;
}
}
class
UnitTestCase
{
protected
$_passed
=
0
;
protected
$_failed
=
0
;
public
function
assertEqual
(
$value
,
$value2
)
{
if
(
$value
==
$value2
)
{
$this
->
_passed
++
;
}
else
{
$this
->
_failed
++
;
}
}
public
function
run
()
{
foreach
(
get_class_methods
(
$this
)
as
$method
)
{
if
(
substr
(
$method
,
0
,
4
)
===
'test'
)
{
$this
->
setUp
();
$this
->
$method
();
}
}
}
public
function
getFailCount
()
{
return
$this
->
_failed
;
}
public
function
getPassCount
()
{
return
$this
->
_passed
;
}
}
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