From e107be56e402e86225998ece858d0abb4a9e5870 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 18 Aug 2023 09:51:15 +0200 Subject: [PATCH 1/3] =?UTF-8?q?N=C2=B06097=20-=20Tests:=20Fix=20missing=20?= =?UTF-8?q?hook=20entry=20in=20PHPUnit=20XML=20file=20that=20led=20to=20co?= =?UTF-8?q?mpiled=20environment=20being=20re-build=20for=20each=20test=20c?= =?UTF-8?q?ase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/phpunit.xml.dist | 4 ++++ tests/php-unit-tests/postbuild_integration.xml.dist | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/php-unit-tests/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist index f16e89560..e116a1417 100644 --- a/tests/php-unit-tests/phpunit.xml.dist +++ b/tests/php-unit-tests/phpunit.xml.dist @@ -19,6 +19,10 @@ printerClass="Sempro\PHPUnitPrettyPrinter\PrettyPrinter" > + + + + diff --git a/tests/php-unit-tests/postbuild_integration.xml.dist b/tests/php-unit-tests/postbuild_integration.xml.dist index 444df800f..a29e2eeec 100644 --- a/tests/php-unit-tests/postbuild_integration.xml.dist +++ b/tests/php-unit-tests/postbuild_integration.xml.dist @@ -19,6 +19,10 @@ printerClass="Sempro\PHPUnitPrettyPrinter\PrettyPrinter" > + + + + From 1990ccb5d84849d8f1f0eaebe00eea794b88dcfb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 18 Aug 2023 09:52:55 +0200 Subject: [PATCH 2/3] =?UTF-8?q?N=C2=B06436=20-=20Move=20interfaces=20enume?= =?UTF-8?q?ration=20from=201=20line=20to=201=20line=20/=20interface=20(and?= =?UTF-8?q?=20re-ordered=20them)=20for=20easier=20merges=20in=20newer=20br?= =?UTF-8?q?anches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/metamodel.class.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 8f987efd2..3ff134fe6 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -2778,7 +2778,23 @@ abstract class MetaModel // Build the list of available extensions // - $aInterfaces = array('iApplicationUIExtension', 'iPreferencesExtension', 'iApplicationObjectExtension', 'iLoginFSMExtension', 'iLoginUIExtension', 'iLogoutExtension', 'iQueryModifier', 'iOnClassInitialization', 'iPopupMenuExtension', 'iPageUIExtension', 'iPortalUIExtension', 'ModuleHandlerApiInterface', 'iNewsroomProvider', 'iModuleExtension', 'iKPILoggerExtension'); + $aInterfaces = [ + 'iLoginFSMExtension', + 'iLogoutExtension', + 'iLoginUIExtension', + 'iPreferencesExtension', + 'iApplicationUIExtension', + 'iApplicationObjectExtension', + 'iPopupMenuExtension', + 'iPageUIExtension', + 'iPortalUIExtension', + 'iQueryModifier', + 'iOnClassInitialization', + 'iModuleExtension', + 'iKPILoggerExtension', + 'ModuleHandlerApiInterface', + 'iNewsroomProvider', + ]; foreach($aInterfaces as $sInterface) { self::$m_aExtensionClasses[$sInterface] = array(); From a8c689c6c00621ae82c3f34a886c96ffff3cc344 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 18 Aug 2023 09:55:45 +0200 Subject: [PATCH 3/3] =?UTF-8?q?N=C2=B06436=20-=20Add=20unit=20test=20to=20?= =?UTF-8?q?ensure=20that=20we=20don't=20lose=20an=20API=20during=20merge?= =?UTF-8?q?=20between=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationExtensionTest.php | 124 ++++++++++ ...plication-extension-usages-in-snippets.xml | 233 ++++++++++++++++++ 2 files changed, 357 insertions(+) create mode 100644 tests/php-unit-tests/unitary-tests/application/applicationextension/ApplicationExtensionTest.php create mode 100644 tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml diff --git a/tests/php-unit-tests/unitary-tests/application/applicationextension/ApplicationExtensionTest.php b/tests/php-unit-tests/unitary-tests/application/applicationextension/ApplicationExtensionTest.php new file mode 100644 index 000000000..997a52258 --- /dev/null +++ b/tests/php-unit-tests/unitary-tests/application/applicationextension/ApplicationExtensionTest.php @@ -0,0 +1,124 @@ +assertGreaterThan(0, $iExtendingClassesCount, "Found no class extending the $sAPIFQCN API"); + } + + public function ExtensionAPIRegisteredAndCalledProvider(): array + { + // APIs not concerned by this test: + // * \iRestServiceProvider as it is discovered by iterating over declared classes directly + // * \iLoginUIExtension as it is not iterated directly, only its derived interfaces + + return [ + \iLoginFSMExtension::class => [ + \iLoginFSMExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iLogoutExtension::class => [ + \iLogoutExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iLoginUIExtension::class => [ + \iLoginUIExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iPreferencesExtension::class => [ + \iPreferencesExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iApplicationUIExtension::class => [ + \iApplicationUIExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iApplicationObjectExtension::class => [ + \iApplicationObjectExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iPopupMenuExtension::class => [ + \iPopupMenuExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iPageUIExtension::class => [ + \iPageUIExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iPortalUIExtension::class => [ + \iPortalUIExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iQueryModifier::class => [ + \iQueryModifier::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iOnClassInitialization::class => [ + \iOnClassInitialization::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iModuleExtension::class => [ + \iModuleExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iKPILoggerExtension::class => [ + \iKPILoggerExtension::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \ModuleHandlerApiInterface::class => [ + \ModuleHandlerApiInterface::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + \iNewsroomProvider::class => [ + \iNewsroomProvider::class, + static::ENUM_API_CALL_METHOD_ENUMPLUGINS, + ], + ]; + } +} diff --git a/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml b/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml new file mode 100644 index 000000000..e404ac49d --- /dev/null +++ b/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml @@ -0,0 +1,233 @@ + + + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + core + 0 + + + + + core + 0 + + + + + core + 0 + + + + \ No newline at end of file