Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7428886
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
Sun, Nov 22, 09:42 (12 h, 56 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
81/00/46c1b3136d4e68189b53e5083e22
Default Alt Text
SubsetTest.php (724 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment