File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @see https://github.com/phly/phly-event-dispatcher for the canonical source repository
4+ * @copyright Copyright (c) 2019 Matthew Weier O'Phinney (https:/mwop.net)
5+ * @license https://github.com/phly/phly-event-dispatcher/blob/master/LICENSE.md New BSD License
6+ */
7+
8+ namespace PhlyTest \EventDispatcher \Exception ;
9+
10+ use Phly \EventDispatcher \Exception \InvalidListenerException ;
11+ use PHPUnit \Framework \TestCase ;
12+
13+ class InvalidListenerExceptionTest extends TestCase
14+ {
15+ public function testForNonCallableService ()
16+ {
17+ $ instance = InvalidListenerException::forNonCallableService ($ this );
18+ $ this ->assertInstanceOf (InvalidListenerException::class, $ instance );
19+ $ this ->assertContains ('type "object" is invalid; must be a PHP callable ' , $ instance ->getMessage ());
20+ }
21+
22+ public function testForNonCallableInstance ()
23+ {
24+ $ instance = InvalidListenerException::forNonCallableInstance ($ this );
25+ $ this ->assertInstanceOf (InvalidListenerException::class, $ instance );
26+ $ this ->assertContains ('type " ' . __CLASS__ . '" is invalid; must be a callable ' , $ instance ->getMessage ());
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments