Skip to content

Commit 4556854

Browse files
committed
custom event class
1 parent 187e0d9 commit 4556854

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Maker/MakeSubscriberTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@ public function getTestDetails(): \Generator
4242
}),
4343
];
4444

45+
yield 'it_makes_subscriber_for_custom_event_class' => [$this->createMakerTest()
46+
->run(function (MakerTestRunner $runner) {
47+
$runner->runMaker(
48+
[
49+
// subscriber name
50+
'FooBar',
51+
// event name
52+
\Symfony\Bundle\MakerBundle\Generator::class,
53+
]
54+
);
55+
56+
self::assertStringContainsString(
57+
'Generator::class => \'onGenerator\'',
58+
file_get_contents($runner->getPath('src/EventSubscriber/FooBarSubscriber.php'))
59+
);
60+
}),
61+
];
62+
4563
yield 'it_makes_subscriber_for_unknown_event_class' => [$this->createMakerTest()
4664
->run(function (MakerTestRunner $runner) {
4765
$runner->runMaker(

0 commit comments

Comments
 (0)