Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5961348
CollectTest.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
CollectTest.php
View Options
<?php
use
Eris\Generators
;
use
Eris\Listeners
;
use
Eris\TestTrait
;
class
CollectTest
extends
\PHPUnit\Framework\TestCase
{
use
TestTrait
;
public
function
testGeneratedDataCollectionOnScalars
()
{
$this
->
forAll
(
Generators
::
neg
())
->
hook
(
Listeners
::
collectFrequencies
())
->
then
(
function
(
$x
)
{
$this
->
assertTrue
(
$x
<
$x
+
1
);
});
}
public
function
testGeneratedDataCollectionOnMoreComplexDataStructures
()
{
$this
->
forAll
(
Generators
::
vector
(
2
,
Generators
::
int
()),
Generators
::
char
()
)
->
hook
(
Listeners
::
collectFrequencies
())
->
then
(
function
(
$vector
)
{
$this
->
assertEquals
(
2
,
count
(
$vector
));
});
}
public
function
testGeneratedDataCollectionWithCustomMapper
()
{
$this
->
forAll
(
Generators
::
seq
(
Generators
::
nat
())
)
->
withMaxSize
(
10
)
->
hook
(
Listeners
::
collectFrequencies
(
function
(
$array
)
{
return
count
(
$array
);
}))
->
then
(
function
(
$array
)
{
$this
->
assertEquals
(
count
(
$array
),
count
(
array_reverse
(
$array
)));
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 08:01 (2 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2e/64/4b370ba4ade11af3db8be9aaac2e
Default Alt Text
CollectTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment