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
60333c04
Commit
60333c04
authored
Jun 17, 2015
by
Bill Schaller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DbalPerformanceTestCase
parent
c079d137
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
DbalPerformanceTestCase.php
tests/Doctrine/Tests/DbalPerformanceTestCase.php
+62
-0
No files found.
tests/Doctrine/Tests/DbalPerformanceTestCase.php
0 → 100644
View file @
60333c04
<?php
namespace
Doctrine\Tests
;
/**
* Class DbalPerformanceTestCase
* @package Doctrine\Tests\DBAL
* @author Bill Schaller
* @author robo
*/
class
DbalPerformanceTestCase
extends
DbalFunctionalTestCase
{
/**
* @var integer
*/
protected
$maxRunningTime
=
0
;
/**
* @return void
*/
protected
function
runTest
()
{
$s
=
microtime
(
true
);
parent
::
runTest
();
$time
=
microtime
(
true
)
-
$s
;
if
(
$this
->
maxRunningTime
!=
0
&&
$time
>
$this
->
maxRunningTime
)
{
$this
->
fail
(
sprintf
(
'expected running time: <= %s but was: %s'
,
$this
->
maxRunningTime
,
$time
)
);
}
}
/**
* @param integer $maxRunningTime
*
* @return void
*
* @throws \InvalidArgumentException
*/
public
function
setMaxRunningTime
(
$maxRunningTime
)
{
if
(
is_integer
(
$maxRunningTime
)
&&
$maxRunningTime
>=
0
)
{
$this
->
maxRunningTime
=
$maxRunningTime
;
}
else
{
throw
new
\InvalidArgumentException
;
}
}
/**
* @return integer
*/
public
function
getMaxRunningTime
()
{
return
$this
->
maxRunningTime
;
}
}
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