addServiceProvider(new PersonServiceProvider()); $this->assertTrue( $container->has('boot'), 'Should have service defined in bootstrap.' ); $this->assertSame('boot', $container->get('boot')->name); } public function testServicesHook(): void { $container = new Container(); $container->addServiceProvider(new PersonServiceProvider()); $this->assertTrue($container->has('sally'), 'Should have service'); $this->assertSame('sally', $container->get('sally')->name); } public function testEmptyProvides(): void { $this->expectException(LogicException::class); $provider = new EmptyServiceProvider(); $provider->provides('sally'); } }