ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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...
 

Static Public Member Functions

static methods ()
 

Detailed Description

Definition at line 29 of file LazyProvideTest.php.

Member Function Documentation

◆ methods()

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

Definition at line 57 of file LazyProvideTest.php.

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

◆ testConstruct()

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

Definition at line 33 of file LazyProvideTest.php.

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

◆ testMethods()

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

methods

Definition at line 41 of file LazyProvideTest.php.

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

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