55use Magento \Framework \Module \ModuleList ;
66use Magento \TestFramework \Fixture \AppArea ;
77use Magento \TestFramework \Fixture \AppIsolation ;
8+ use Magento \TestFramework \Fixture \Cache ;
89use Magento \TestFramework \Fixture \ComponentsDir ;
10+ use PHPUnit \Framework \Attributes \DataProvider ;
911use Yireo \IntegrationTestHelper \Test \Integration \Traits \AssertModuleIsEnabled ;
1012use Yireo \IntegrationTestHelper \Test \Integration \Traits \AssertModuleIsRegistered ;
1113use Magento \Framework \Module \Status as ModuleStatus ;
@@ -21,25 +23,37 @@ class TargetRendererWithCustomPageLayoutTest extends AbstractTargetRendererTestC
2123 use AssertModuleIsEnabled;
2224
2325 #[AppIsolation(true )]
24- public function testCustomPageLayout (): void
26+ #[Cache('all ' , true )]
27+ #[Cache('layout ' , false )]
28+ #[DataProvider('getTestData ' )]
29+ public function testCustomPageLayout (bool $ isolated ): void
2530 {
26- // $this->enableModule('LokiTest_CustomPageLayout');
31+ $ this ->enableModule ('LokiTest_CustomPageLayout ' );
2732
2833 $ handles = ['default ' ];
2934 $ pageHandles = ['loki_test ' ];
3035 $ blockName = 'loki-test-block ' ;
31- $ layout = $ this ->getLayoutLoader ()->load ($ handles , $ pageHandles , false );
36+ $ layout = $ this ->getLayoutLoader ()->load ($ handles , $ pageHandles , $ isolated );
3237
3338 $ allBlockNames = array_keys ($ layout ->getAllBlocks ());
3439 $ this ->assertNotEmpty ($ allBlockNames );
3540
3641 $ debugMsg = 'Blocks: ' .implode (', ' , $ allBlockNames );
3742 $ this ->assertContains ($ blockName , $ allBlockNames , $ debugMsg );
3843
39- $ htmlParts = $ this ->getTargetRenderer ()->render ($ layout , [$ blockName ], false );
44+ $ htmlParts = $ this ->getTargetRenderer ()->render ($ layout , [$ blockName ]);
4045 $ this ->assertNotEmpty ($ htmlParts );
4146 }
4247
48+
49+ public static function getTestData (): array
50+ {
51+ return [
52+ [false ],
53+ [true ],
54+ ];
55+ }
56+
4357 private function enableModule (string $ moduleName = '' ): void
4458 {
4559 $ this ->assertModuleIsRegistered ($ moduleName );
0 commit comments