Skip to content

Commit

Permalink
Test invoke method
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jan 17, 2023
1 parent 7453ca0 commit 039a042
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Unit/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 039a042

Please sign in to comment.