Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5937762
RandConfigurationTest.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
RandConfigurationTest.php
View Options
<?php
use
Eris\Generators
;
use
Eris\Random
;
use
Eris\TestTrait
;
class
RandConfigurationTest
extends
\PHPUnit\Framework\TestCase
{
use
TestTrait
;
public
function
testUsingTheDefaultRandFunction
()
{
$this
->
withRand
(
'rand'
)
->
forAll
(
Generators
::
int
()
)
->
withMaxSize
(
1000
*
1000
*
1000
)
->
then
(
$this
->
isInteger
());
}
/**
* @eris-method rand
*/
public
function
testUsingTheDefaultRandFunctionFromAnnotation
()
{
$this
->
forAll
(
Generators
::
int
()
)
->
withMaxSize
(
1000
*
1000
*
1000
)
->
then
(
$this
->
isInteger
());
}
public
function
testUsingTheDefaultMtRandFunction
()
{
$this
->
withRand
(
'mt_rand'
)
->
forAll
(
Generators
::
int
()
)
->
then
(
$this
->
isInteger
());
}
/**
* @eris-method mt_rand
*/
public
function
testUsingTheDefaultMtRandFunctionFromAnnotation
()
{
$this
->
forAll
(
Generators
::
int
()
)
->
then
(
$this
->
isInteger
());
}
public
function
testUsingThePurePhpMtRandFunction
()
{
if
(
defined
(
'HHVM_VERSION'
))
{
$this
->
markTestSkipped
(
'MersenneTwister class does not support HHVM'
);
}
$this
->
withRand
(
Random\purePhpMtRand
())
->
forAll
(
Generators
::
int
()
)
->
then
(
$this
->
isInteger
());
}
private
function
isInteger
()
{
return
function
(
$number
)
{
\Eris\PHPUnitDeprecationHelper
::
assertIsInt
(
$number
);
};
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 2 2026, 16:00 (6 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
13/69/4babdeb382c424d6ffa357f5492f
Default Alt Text
RandConfigurationTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment