Private GIT

Skip to content
Snippets Groups Projects
Commit 38fef07e authored by mariegallardo's avatar mariegallardo Committed by Kev
Browse files

Test fixed (#5424)

parent 9b49e0ac
No related branches found
No related tags found
No related merge requests found
...@@ -156,12 +156,6 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -156,12 +156,6 @@ class ACLMenusAccessContext extends CentreonContext
*/ */
public function oneExistingACLMenuAccessLinkedWithTwoAccessGroups() public function oneExistingACLMenuAccessLinkedWithTwoAccessGroups()
{ {
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup1);
$this->currentPage->save();
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup2);
$this->currentPage->save();
$this->currentPage = new ACLMenuConfigurationPage($this); $this->currentPage = new ACLMenuConfigurationPage($this);
$this->currentPage->setProperties($this->initialProperties); $this->currentPage->setProperties($this->initialProperties);
$this->currentPage->save(); $this->currentPage->save();
...@@ -223,12 +217,6 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -223,12 +217,6 @@ class ACLMenusAccessContext extends CentreonContext
*/ */
public function oneExistingMenuAccess() public function oneExistingMenuAccess()
{ {
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup1);
$this->currentPage->save();
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup2);
$this->currentPage->save();
$this->currentPage = new ACLMenuConfigurationPage($this); $this->currentPage = new ACLMenuConfigurationPage($this);
$this->currentPage->setProperties($this->initialProperties); $this->currentPage->setProperties($this->initialProperties);
$this->currentPage->save(); $this->currentPage->save();
...@@ -302,12 +290,6 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -302,12 +290,6 @@ class ACLMenusAccessContext extends CentreonContext
*/ */
public function oneExistingEnabledMenuAccess() public function oneExistingEnabledMenuAccess()
{ {
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup1);
$this->currentPage->save();
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup2);
$this->currentPage->save();
$this->currentPage = new ACLMenuConfigurationPage($this); $this->currentPage = new ACLMenuConfigurationPage($this);
$this->currentPage->setProperties($this->initialProperties); $this->currentPage->setProperties($this->initialProperties);
$this->currentPage->save(); $this->currentPage->save();
...@@ -352,22 +334,6 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -352,22 +334,6 @@ class ACLMenusAccessContext extends CentreonContext
* @When I delete the Menu access * @When I delete the Menu access
*/ */
public function iDeleteTheMenuAccess() public function iDeleteTheMenuAccess()
{
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup1);
$this->currentPage->save();
$this->currentPage = new ACLGroupConfigurationPage($this);
$this->currentPage->setProperties($this->aclGroup2);
$this->currentPage->save();
$this->currentPage = new ACLMenuConfigurationPage($this);
$this->currentPage->setProperties($this->initialProperties);
$this->currentPage->save();
}
/**
* @Then the menu access record is not visible anymore in Menus Access Page
*/
public function theMenuAccessRecordIsNotVisibleAnymoreInMenusAccessPage()
{ {
$this->currentPage = new ACLMenuConfigurationListingPage($this); $this->currentPage = new ACLMenuConfigurationListingPage($this);
$object = $this->currentPage->getEntry($this->initialProperties['acl_name']); $object = $this->currentPage->getEntry($this->initialProperties['acl_name']);
...@@ -377,9 +343,9 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -377,9 +343,9 @@ class ACLMenusAccessContext extends CentreonContext
} }
/** /**
* @Then the link with access groups is broken * @Then the menu access record is not visible anymore in Menus Access Page
*/ */
public function theLinkWithAccessGroupIsBroken() public function theMenuAccessRecordIsNotVisibleAnymoreInMenusAccessPage()
{ {
$this->spin( $this->spin(
function ($context) { function ($context) {
...@@ -395,4 +361,36 @@ class ACLMenusAccessContext extends CentreonContext ...@@ -395,4 +361,36 @@ class ACLMenusAccessContext extends CentreonContext
5 5
); );
} }
/**
* @Then the link with access groups is broken
*/
public function theLinkWithAccessGroupIsBroken()
{
$this->tableau = array();
try {
$this->spin(
function ($context) {
$this->currentPage = new ACLGroupConfigurationListingPage($this);
$this->currentPage = $this->currentPage->inspect($this->aclGroup1['group_name']);
$object = $this->currentPage->getProperties();
if (count($object['menu']) != 0) {
$this->tableau[] = $this->aclGroup1['group_name'];
}
$this->currentPage = new ACLGroupConfigurationListingPage($this);
$this->currentPage = $this->currentPage->inspect($this->aclGroup2['group_name']);
$object = $this->currentPage->getProperties();
if (count($object['menu']) != 0) {
$this->tableau[] = $this->aclGroup2['group_name'];
}
return count($this->tableau) == 0;
},
"Some links to the ACL Menu are not being deleted.",
5
);
} catch (\Exception $e) {
$this->tableau = array_unique($this->tableau);
throw new \Exception("Some links to the ACL Menu are not being deleted. : " . implode(',', $this->tableau));
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment