diff --git a/tests/Unit/ContainerTest.php b/tests/Unit/ContainerTest.php index db75970..f06165c 100644 --- a/tests/Unit/ContainerTest.php +++ b/tests/Unit/ContainerTest.php @@ -772,6 +772,31 @@ public function testContainerImplementsPropertyAccessorMagicMethods(string $meth self::assertFalse(isset($this->container->{$method})); } + /** + * @covers \Ghostwriter\Container\Container::__construct + * @covers \Ghostwriter\Container\Container::__destruct + * @covers \Ghostwriter\Container\Container::call + * @covers \Ghostwriter\Container\Container::invoke + * @covers \Ghostwriter\Container\Container::resolve + * @covers \Ghostwriter\Container\Container::get + * @covers \Ghostwriter\Container\Container::build + * @covers \Ghostwriter\Container\Container::getInstance + * @covers \Ghostwriter\Container\Container::getParametersForCallable + * + * @throws Throwable + */ + public function testContainerInvoke(): void + { + $iter = $this->container->invoke(Dummy::class); + self::assertSame('Untitled', $iter); + + $iter = $this->container->invoke(Dummy::class, [ + 'data'=>[], + 'text'=>'#BlackLivesMatter', + ]); + self::assertSame('#BlackLivesMatter', $iter); + } + /** * @covers \Ghostwriter\Container\Container::__destruct * @covers \Ghostwriter\Container\Container::add