Definition at line 9 of file ilRandomTest.php.
◆ intArguments()
| ilRandomTest::intArguments |
( |
| ) |
|
Definition at line 60 of file ilRandomTest.php.
60 : array
61 {
62 return [
63 'No arguments can be provided' => [],
64 'One argument can be provided' => [34],
65 '2 arguments can be provided' => [-20, 30],
66 'The limit is inclusive' => [8, 8]
67 ];
68 }
◆ testConstruct()
| ilRandomTest::testConstruct |
( |
| ) |
|
Definition at line 11 of file ilRandomTest.php.
11 : void
12 {
13 $this->assertInstanceOf(\ilRandom::class,
new ilRandom());
14 }
Wrapper for generation of random numbers, strings, bytes.
◆ testIntSuccessfully()
| ilRandomTest::testIntSuccessfully |
( |
int ... |
$arguments | ) |
|
@dataProvider intArguments
Definition at line 19 of file ilRandomTest.php.
19 : void
20 {
21 $this->expectNotToPerformAssertions();
22
23 $random = new \ilRandom();
24 try {
25 $random->int(...$arguments);
27 $this->fail('Expected no exception.');
28 }
29 }
References Vendor\Package\$e.
◆ testIntWithInvalidArguments()
| ilRandomTest::testIntWithInvalidArguments |
( |
| ) |
|
Definition at line 31 of file ilRandomTest.php.
31 : void
32 {
33 $this->expectException(Error::class);
34 $random = new \ilRandom();
35
36 $random->int(10, 9);
37 }
◆ testLogIfPossible()
| ilRandomTest::testLogIfPossible |
( |
| ) |
|
Definition at line 39 of file ilRandomTest.php.
39 : void
40 {
41 $this->expectException(Error::class);
42
43 $logger = $this->getMockBuilder(\ilLogger::class)->disableOriginalConstructor()->getMock();
45 $logger->expects(self::once())->method('error');
46
47 $factory = $this->getMockBuilder(ilLoggerFactory::class)->disableOriginalConstructor()->getMock();
48 $factory->expects(self::once())->method(
'getComponentLogger')->with(
'rnd')->willReturn($logger);
49
53 };
54 $random = new \ilRandom();
55 $random->int(10, 9);
56
58 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Customizing of pimple-DIC for ILIAS.
References $factory, $GLOBALS, and ilLogLevel\ERROR.
The documentation for this class was generated from the following file: