19declare(strict_types=1);
24use PHPUnit\Framework\TestCase;
26use PHPUnit\Framework\Attributes\DataProvider;
28require_once __DIR__ .
'/ContainerMock.php';
36 $this->assertInstanceOf(LazyProvide::class,
new LazyProvide($this->fail(...)));
39 #[DataProvider('methods')]
40 public function testMethods(
string $method, $return = []): void
43 $provide = $this->mockTree(Provide::class, [$method => $return]);
45 $create =
function () use (&$called, $provide) {
51 $this->assertFalse($called);
52 $this->assertSame($provide->$method(), $instance->$method());
53 $this->assertTrue($called);
testMethods(string $method, $return=[])