File tree 2 files changed +20
-1
lines changed
dev/tests/unit/Magento/FunctionalTestFramework/Page/Handlers
src/Magento/FunctionalTestingFramework/Page/Handlers
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,25 @@ public function testGetPageObject()
51
51
$ this ->assertNull ($ invalidPage );
52
52
}
53
53
54
+ public function testGetEmptyPage ()
55
+ {
56
+ $ mockData = [
57
+ "testPage1 " => [
58
+ "url " => "testURL1 " ,
59
+ "module " => "testModule1 " ,
60
+ "section " => [
61
+ ],
62
+ "area " => "test "
63
+ ]];
64
+ $ this ->setMockParserOutput ($ mockData );
65
+
66
+ // get pages
67
+ $ page = PageObjectHandler::getInstance ()->getObject ('testPage1 ' );
68
+
69
+ // Empty page has been read in and gotten without an exception being thrown.
70
+ $ this ->addToAssertionCount (1 );
71
+ }
72
+
54
73
/**
55
74
* Function used to set mock for parser return and force init method to run between tests.
56
75
*
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ private function __construct()
62
62
}
63
63
64
64
$ module = $ pageData [self ::MODULE ];
65
- $ sectionNames = array_keys ($ pageData [self ::SECTION ]);
65
+ $ sectionNames = array_keys ($ pageData [self ::SECTION ] ?? [] );
66
66
$ parameterized = $ pageData [self ::PARAMETERIZED ] ?? false ;
67
67
68
68
$ this ->pageObjects [$ pageName ] =
You can’t perform that action at this time.
0 commit comments