Skip to content

Commit 952cf61

Browse files
committed
- adds test for the new E_CANNOT_BIND_INTERFACE exception
1 parent 50bf3ee commit 952cf61

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Tests/Unit/ExceptionsTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ public function testExceptionForInvokeMethod()
9191
($this->di)([new TestExceptionForInvokeMethod, 'fail']);
9292
}
9393

94+
public function testInterfaceToInterfaceBinding()
95+
{
96+
$this->expectException(DIException::class);
97+
$this->expectExceptionCode(DIException::E_CANNOT_BIND_INTERFACE);
98+
$this->expectExceptionMessage('Only interface to class binding is allowed. Cannot bind interface ');
99+
$this->di->bind(TestInterface::class, TestOtherInterface::class);
100+
}
101+
94102
protected function createContainer(): DIContainer
95103
{
96104
return new DIContainer;

0 commit comments

Comments
 (0)