area); self::assertSame(DiviAreas::CATALOG, DynamicContentMap::manifest()->area); } public function testManifestListsModuleRegistrationAndTheBuilderSwitch(): void { $manifest = DiviModules::manifest(); self::assertSame( [ 'ModuleRegistration::get_all_core_modules_metadata()', 'ModuleRegistration::get_default_attrs()', 'et_builder_enabled_for_post_type()', ], array_map(static fn (Call $call): string => $call->label(), $manifest->calls) ); self::assertSame(['divi/global-layout'], $manifest->blockTypes); self::assertSame( ['ET_BUILDER_PRODUCT_VERSION'], array_map(static fn (ConstantRequirement $constant): string => $constant->name, $manifest->constants) ); } public function testInternalPostTypesAreDivisOwn(): void { self::assertSame( [ 'et_pb_layout', 'et_theme_builder', 'et_template', 'et_header_layout', 'et_body_layout', 'et_footer_layout', 'et_pb_canvas', '_et_pb_speculation', ], DiviModules::INTERNAL_POST_TYPES ); } public function testBuilderEnabledForAsksDivi(): void { Functions\when('et_builder_enabled_for_post_type')->alias(static fn (string $type): bool => $type === 'page'); self::assertTrue(DiviModules::builderEnabledFor('page')); self::assertFalse(DiviModules::builderEnabledFor('post')); } }