File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+ /*
3
+ * This file is part of PHPUnit.
4
+ *
5
+ * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ namespace PHPUnit \Event ;
11
+
12
+ use PHPUnit \Event \Tracer \Tracer ;
13
+ use PHPUnit \Framework \Attributes \CoversClass ;
14
+ use PHPUnit \Framework \Attributes \Small ;
15
+ use PHPUnit \Framework \TestCase ;
16
+
17
+ #[CoversClass(Facade::class)]
18
+ #[Small]
19
+ final class FacadeTest extends TestCase
20
+ {
21
+ public function testSubscriberRegistrationDoesNotWorkWhenEventFacadeIsSealed (): void
22
+ {
23
+ $ this ->expectException (EventFacadeIsSealedException::class);
24
+
25
+ Facade::instance ()->registerSubscriber (
26
+ new class implements Subscriber
27
+ {},
28
+ );
29
+ }
30
+
31
+ public function testTracerRegistrationDoesNotWorkWhenEventFacadeIsSealed (): void
32
+ {
33
+ $ this ->expectException (EventFacadeIsSealedException::class);
34
+
35
+ Facade::instance ()->registerTracer (
36
+ new class implements Tracer
37
+ {
38
+ public function trace (Event $ event ): void
39
+ {
40
+ }
41
+ },
42
+ );
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments