File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \Notifier \Bridge \Zulip \ZulipTransportFactory ;
16
16
use Symfony \Component \Notifier \Exception \IncompleteDsnException ;
17
+ use Symfony \Component \Notifier \Exception \MissingRequiredOptionException ;
17
18
use Symfony \Component \Notifier \Exception \UnsupportedSchemeException ;
18
19
use Symfony \Component \Notifier \Transport \Dsn ;
19
20
@@ -28,11 +29,11 @@ public function testCreateWithDsn()
28
29
$ this ->assertSame ('zulip://host.test?channel=testChannel ' , (string ) $ transport );
29
30
}
30
31
31
- public function testCreateWithMissingOptionChannelThrowsIncompleteDsnException ()
32
+ public function testCreateWithMissingOptionChannelThrowsMissingRequiredOptionException ()
32
33
{
33
34
$ factory = $ this ->createFactory ();
34
35
35
- $ this ->expectException (IncompleteDsnException ::class);
36
+ $ this ->expectException (MissingRequiredOptionException ::class);
36
37
37
38
$ factory ->create (Dsn::fromString ('zulip://email:token@host ' ));
38
39
}
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Notifier \Bridge \Zulip ;
13
13
14
- use Symfony \Component \Notifier \Exception \IncompleteDsnException ;
15
14
use Symfony \Component \Notifier \Exception \UnsupportedSchemeException ;
16
15
use Symfony \Component \Notifier \Transport \AbstractTransportFactory ;
17
16
use Symfony \Component \Notifier \Transport \Dsn ;
@@ -35,12 +34,7 @@ public function create(Dsn $dsn): TransportInterface
35
34
36
35
$ email = $ this ->getUser ($ dsn );
37
36
$ token = $ this ->getPassword ($ dsn );
38
- $ channel = $ dsn ->getOption ('channel ' );
39
-
40
- if (!$ channel ) {
41
- throw new IncompleteDsnException ('Missing channel. ' , $ dsn ->getOriginalDsn ());
42
- }
43
-
37
+ $ channel = $ dsn ->getRequiredOption ('channel ' );
44
38
$ host = $ dsn ->getHost ();
45
39
$ port = $ dsn ->getPort ();
46
40
You can’t perform that action at this time.
0 commit comments