Skip to content

Commit

Permalink
test exception PSR-11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Vaughn committed Dec 12, 2020
1 parent 2eb5007 commit a96a985
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/OpenContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use modethirteen\OpenContainer\OpenContainerCannotBuildDeferredInstanceException;
use modethirteen\OpenContainer\OpenContainerNotRegisteredInContainerException;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

/**
* Class OpenContainerTest
Expand Down Expand Up @@ -250,4 +252,14 @@ public function Can_check_if_dependency_is_resolved(IDependencyContainer $contai
static::assertTrue($result2);
}
}

/**
* @test
*/
public function Exceptions_are_PSR11_compatible() : void {

// assert
static::assertInstanceOf(NotFoundExceptionInterface::class, new OpenContainerNotRegisteredInContainerException('foo'));
static::assertInstanceOf(ContainerExceptionInterface::class, new OpenContainerCannotBuildDeferredInstanceException('foo'));
}
}

0 comments on commit a96a985

Please sign in to comment.