20
20
21
21
class TransportsTest extends TestCase
22
22
{
23
- public function test_send_to_transport_defined_by_message (): void
23
+ public function testSendToTransportDefinedByMessage (): void
24
24
{
25
25
$ transports = new Transports ([
26
26
'one ' => $ one = $ this ->createMock (TransportInterface::class),
@@ -35,31 +35,25 @@ public function test_send_to_transport_defined_by_message(): void
35
35
$ transports ->send ($ message );
36
36
}
37
37
38
- public function test_send_to_all_supported_transports_if_message_does_not_define_a_transport (): void
38
+ public function testSendToFirstSupportedTransportIfMessageDoesNotDefineATransport (): void
39
39
{
40
40
$ transports = new Transports ([
41
41
'one ' => $ one = $ this ->createMock (TransportInterface::class),
42
42
'two ' => $ two = $ this ->createMock (TransportInterface::class),
43
- 'three ' => $ three = $ this ->createMock (TransportInterface::class),
44
- 'four ' => $ four = $ this ->createMock (TransportInterface::class),
45
43
]);
46
44
47
45
$ message = new ChatMessage ('subject ' );
48
46
49
47
$ one ->method ('supports ' )->with ($ message )->willReturn (false );
50
48
$ two ->method ('supports ' )->with ($ message )->willReturn (true );
51
- $ three ->method ('supports ' )->with ($ message )->willReturn (false );
52
- $ four ->method ('supports ' )->with ($ message )->willReturn (true );
53
49
54
50
$ one ->expects ($ this ->never ())->method ('send ' );
55
51
$ two ->expects ($ this ->once ())->method ('send ' );
56
- $ three ->expects ($ this ->never ())->method ('send ' );
57
- $ four ->expects ($ this ->once ())->method ('send ' );
58
52
59
53
$ transports ->send ($ message );
60
54
}
61
55
62
- public function test_throw_exception_if_no_supported_transport_was_found (): void
56
+ public function testThrowExceptionIfNoSupportedTransportWasFound (): void
63
57
{
64
58
$ transports = new Transports ([
65
59
'one ' => $ one = $ this ->createMock (TransportInterface::class),
@@ -75,7 +69,7 @@ public function test_throw_exception_if_no_supported_transport_was_found(): void
75
69
$ transports ->send ($ message );
76
70
}
77
71
78
- public function test_throw_exception_if_transport_defined_by_message_is_not_supported (): void
72
+ public function testThrowExceptionIfTransportDefinedByMessageIsNotSupported (): void
79
73
{
80
74
$ transports = new Transports ([
81
75
'one ' => $ one = $ this ->createMock (TransportInterface::class),
@@ -94,7 +88,7 @@ public function test_throw_exception_if_transport_defined_by_message_is_not_supp
94
88
$ transports ->send ($ message );
95
89
}
96
90
97
- public function test_throw_exception_if_transport_defined_by_message_does_not_exist ()
91
+ public function testThrowExceptionIfTransportDefinedByMessageDoesNotExist ()
98
92
{
99
93
$ transports = new Transports ([
100
94
'one ' => $ one = $ this ->createMock (TransportInterface::class),
0 commit comments