Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429577
SubsetTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
724 B
Referenced Files
None
Subscribers
None
SubsetTest.php
View Options
<?php
use
Eris\Generators
;
use
Eris\TestTrait
;
use
PHPUnit\Framework\TestCase
;
class
SubsetTest
extends
TestCase
{
use
TestTrait
;
public
function
testSubsetsOfASet
()
{
$this
->
forAll
(
Generators
::
subset
([
2
,
4
,
6
,
8
,
10
])
)
->
then
(
function
(
$set
)
{
\Eris\PHPUnitDeprecationHelper
::
assertIsArray
(
$set
);
foreach
(
$set
as
$element
)
{
$this
->
assertTrue
(
$this
->
isEven
(
$element
),
"Element $element is not even, where did it come from?"
);
}
var_dump
(
$set
);
});
}
private
function
isEven
(
$number
)
{
return
$number
%
2
==
0
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 17:46 (9 h, 1 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
81/a4/9ad05fa4aab185b9e4856906e6d3
Default Alt Text
SubsetTest.php (724 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment