ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\test\LazyProvideTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\LazyProvideTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\LazyProvideTest:

Public Member Functions

 testConstruct ()
 
 testMethods (string $method, $return=[])
 methods More...
 
 methods ()
 

Detailed Description

Definition at line 30 of file LazyProvideTest.php.

Member Function Documentation

◆ methods()

ILIAS\LegalDocuments\test\LazyProvideTest::methods ( )

Definition at line 58 of file LazyProvideTest.php.

58  : array
59  {
60  return [
61  ['withdrawal'],
62  ['publicPage'],
63  ['document'],
64  ['history'],
65  ['allowEditing'],
66  ['publicApi'],
67  ['id', ''],
68  ];
69  }

◆ testConstruct()

ILIAS\LegalDocuments\test\LazyProvideTest::testConstruct ( )

Definition at line 34 of file LazyProvideTest.php.

34  : void
35  {
36  $this->assertInstanceOf(LazyProvide::class, new LazyProvide($this->fail(...)));
37  }

◆ testMethods()

ILIAS\LegalDocuments\test\LazyProvideTest::testMethods ( string  $method,
  $return = [] 
)

methods

Definition at line 42 of file LazyProvideTest.php.

42  : void
43  {
44  $called = false;
45  $provide = $this->mockTree(Provide::class, [$method => $return]);
46 
47  $create = function () use (&$called, $provide) {
48  $called = true;
49  return $provide;
50  };
51 
52  $instance = new LazyProvide($create);
53  $this->assertFalse($called);
54  $this->assertSame($provide->$method(), $instance->$method());
55  $this->assertTrue($called);
56  }

The documentation for this class was generated from the following file: