aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2025-03-20 21:02:50 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2025-03-20 21:02:50 +0000
commitc1d91b9b89adf93fe6ac8ca272baa9a9c2015e32 (patch)
tree165cc463ed17c55ea18f9126298afb2330d89eac /tests
parent8ef028d2749837d42bf9199fa8bcc293d4281ba1 (diff)
parent33c7de7265b34d896a31e3ba32e58904d19894df (diff)
downloadmediawikicore-c1d91b9b89adf93fe6ac8ca272baa9a9c2015e32.tar.gz
mediawikicore-c1d91b9b89adf93fe6ac8ca272baa9a9c2015e32.zip
Merge "extension.json: DomainEventIngresses instead of DomainEventSubscribers"
Diffstat (limited to 'tests')
-rw-r--r--tests/phpunit/includes/registration/ExtensionRegistrationTest.php2
-rw-r--r--tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php45
2 files changed, 37 insertions, 10 deletions
diff --git a/tests/phpunit/includes/registration/ExtensionRegistrationTest.php b/tests/phpunit/includes/registration/ExtensionRegistrationTest.php
index b17aa67afdef..bf195a36a0aa 100644
--- a/tests/phpunit/includes/registration/ExtensionRegistrationTest.php
+++ b/tests/phpunit/includes/registration/ExtensionRegistrationTest.php
@@ -138,7 +138,7 @@ class ExtensionRegistrationTest extends MediaWikiIntegrationTestCase {
];
$manifest = [
- 'DomainEventSubscribers' => [ $subscriber ]
+ 'DomainEventIngresses' => [ $subscriber ]
];
$file = $this->makeManifestFile( $manifest );
diff --git a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php
index f3a611b99bd1..a85e07a7ed0b 100644
--- a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php
+++ b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php
@@ -596,15 +596,42 @@ class ExtensionProcessorTest extends MediaWikiUnitTestCase {
$processor->getExtractedInfo();
}
- public function provideDomainEventDomainEventSubscribers() {
+ public function provideDomainEventDomainEventIngresses() {
// Format:
- // Current DomainEventSubscribers attribute
+ // Current attributes
// Content in extension.json
- // Expected DomainEventSubscribers attribute
+ // Expected DomainEventIngresses attribute
return [
- [
+ 'DomainEventIngresses' => [
+ [
+ 'DomainEventIngresses' => [
+ [ 'events' => [ 'FooDone' ], 'factory' => 'PriorCallback' ]
+ ]
+ ],
+ [
+ 'DomainEventIngresses' => [
+ [
+ 'events' => [ 'FooDone', 'BarDone', ],
+ 'class' => 'FooClass',
+ 'services' => [],
+ ],
+ ]
+ ] + self::$default,
[
- [ 'events' => [ 'FooDone' ], 'factory' => 'PriorCallback' ]
+ [ 'events' => [ 'FooDone' ], 'factory' => 'PriorCallback' ],
+ [
+ 'events' => [ 'FooDone', 'BarDone', ],
+ 'class' => 'FooClass',
+ 'services' => [],
+ 'extensionPath' => $this->getExtensionPath()
+ ]
+ ]
+ ],
+ 'DomainEventSubscriber (deprecated, T389033)' => [
+ [
+ 'DomainEventIngresses' => [
+ [ 'events' => [ 'FooDone' ], 'factory' => 'PriorCallback' ]
+ ]
],
[
'DomainEventSubscribers' => [
@@ -629,13 +656,13 @@ class ExtensionProcessorTest extends MediaWikiUnitTestCase {
}
/**
- * @dataProvider provideDomainEventDomainEventSubscribers
+ * @dataProvider provideDomainEventDomainEventIngresses
*/
- public function testDomainEventDomainEventSubscribers( $pre, $info, $expected ) {
- $processor = new MockExtensionProcessor( [ 'attributes' => [ 'DomainEventSubscribers' => $pre ] ] );
+ public function testDomainEventDomainEventIngresses( $pre, $info, $expected ) {
+ $processor = new MockExtensionProcessor( [ 'attributes' => $pre ] );
$processor->extractInfo( $this->extensionPath, $info, 1 );
$extracted = $processor->getExtractedInfo();
- $this->assertEquals( $expected, $extracted['attributes']['DomainEventSubscribers'] );
+ $this->assertEquals( $expected, $extracted['attributes']['DomainEventIngresses'] );
}
public function testExtractConfig1() {