Skip to content

MQE-896: Page schema needs to allow empty section #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ public function testGetPageObject()
$this->assertNull($invalidPage);
}

public function testGetEmptyPage()
{
$mockData = [
"testPage1" => [
"url" => "testURL1",
"module" => "testModule1",
"section" => [
],
"area" => "test"
]];
$this->setMockParserOutput($mockData);

// get pages
$page = PageObjectHandler::getInstance()->getObject('testPage1');

// Empty page has been read in and gotten without an exception being thrown.
$this->addToAssertionCount(1);
}

/**
* Function used to set mock for parser return and force init method to run between tests.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function __construct()
}

$module = $pageData[self::MODULE];
$sectionNames = array_keys($pageData[self::SECTION]);
$sectionNames = array_keys($pageData[self::SECTION] ?? []);
$parameterized = $pageData[self::PARAMETERIZED] ?? false;

$this->pageObjects[$pageName] =
Expand Down