Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5950959
TestSuiteIterator.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
TestSuiteIterator.php
View Options
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
PHPUnit\Framework
;
use
function
assert
;
use
function
count
;
use
RecursiveIterator
;
/**
* @template-implements RecursiveIterator<int, Test>
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final
class
TestSuiteIterator
implements
RecursiveIterator
{
/**
* @var int
*/
private
$position
=
0
;
/**
* @var Test[]
*/
private
$tests
;
public
function
__construct
(
TestSuite
$testSuite
)
{
$this
->
tests
=
$testSuite
->
tests
();
}
public
function
rewind
():
void
{
$this
->
position
=
0
;
}
public
function
valid
():
bool
{
return
$this
->
position
<
count
(
$this
->
tests
);
}
public
function
key
():
int
{
return
$this
->
position
;
}
public
function
current
():
Test
{
return
$this
->
tests
[
$this
->
position
];
}
public
function
next
():
void
{
$this
->
position
++;
}
/**
* @throws NoChildTestSuiteException
*/
public
function
getChildren
():
self
{
if
(!
$this
->
hasChildren
())
{
throw
new
NoChildTestSuiteException
(
'The current item is not a TestSuite instance and therefore does not have any children.'
,
);
}
$current
=
$this
->
current
();
assert
(
$current
instanceof
TestSuite
);
return
new
self
(
$current
);
}
public
function
hasChildren
():
bool
{
return
$this
->
valid
()
&&
$this
->
current
()
instanceof
TestSuite
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 3 2026, 00:26 (5 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
43/ee/a302db371d0a12fdd025af78b138
Default Alt Text
TestSuiteIterator.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment