Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92592784
FutureIteratorTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Nov 21, 19:28
Size
530 B
Mime Type
text/x-php
Expires
Sat, Nov 23, 19:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22466175
Attached To
rPHU libphutil
FutureIteratorTestCase.php
View Options
<?php
/**
* @group testcase
*/
final
class
FutureIteratorTestCase
extends
PhutilTestCase
{
public
function
testAddingFuture
()
{
$future1
=
new
ExecFuture
(
'cat'
);
$future2
=
new
ExecFuture
(
'cat'
);
$iterator
=
new
FutureIterator
(
array
(
$future1
));
$iterator
->
limit
(
2
);
$results
=
array
();
foreach
(
$iterator
as
$future
)
{
if
(
$future
===
$future1
)
{
$iterator
->
addFuture
(
$future2
);
}
$results
[]
=
$future
->
resolve
();
}
$this
->
assertEqual
(
2
,
count
(
$results
));
}
}
Event Timeline
Log In to Comment