diff --git a/tests/Provider/EventTest.php b/tests/Provider/EventTest.php new file mode 100644 index 0000000..c76198e --- /dev/null +++ b/tests/Provider/EventTest.php @@ -0,0 +1,25 @@ +register( $container ); + + $this->assertArrayHasKey( 'hook.events', $container ); + + foreach ( $container['hook.events'] as $config ) { + $this->assertInstanceOf( Hook_Event_Config_Interface::class, $config ); + } + } +} diff --git a/tests/Provider/ManagerTest.php b/tests/Provider/ManagerTest.php new file mode 100644 index 0000000..98e09fe --- /dev/null +++ b/tests/Provider/ManagerTest.php @@ -0,0 +1,29 @@ +register( $container ); + + $this->assertArrayHasKey( 'managers', $container ); + + $container->extend( 'managers', function () {} ); + $provider->boot( $container ); + $this->expectException( FrozenServiceException::class ); + $container->extend( 'managers', function () {} ); + } +} diff --git a/tests/Provider/RecordTest.php b/tests/Provider/RecordTest.php new file mode 100644 index 0000000..fbee7aa --- /dev/null +++ b/tests/Provider/RecordTest.php @@ -0,0 +1,35 @@ +register( $container ); + + $stopwatch_a = $container['stopwatch']; + $stopwatch_b = $container['stopwatch']; + + $this->assertNotSame( $stopwatch_a, $stopwatch_b ); + + $this->assertArrayHasKey( 'records', $container ); + + $container->extend( 'collectors', function () {} ); + $provider->boot( $container ); + $this->expectException( FrozenServiceException::class ); + $container->extend( 'collectors', function () {} ); + + } +}