Skip to content

Commit

Permalink
Merge branch '6.7' into 6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Nov 15, 2017
2 parents ac0be44 + 995c16b commit c756bf9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Repository/Tests/ObjectStateServiceTest.php
Expand Up @@ -614,6 +614,9 @@ public function testUpdateObjectStateGroup()
$objectStateGroupId
);

// pre populate any kind of cache for all
$objectStateService->loadObjectStateGroups();

$groupUpdateStruct = $objectStateService->newObjectStateGroupUpdateStruct();
$groupUpdateStruct->identifier = 'sindelfingen';
$groupUpdateStruct->defaultLanguageCode = 'ger-DE';
Expand All @@ -630,6 +633,8 @@ public function testUpdateObjectStateGroup()
$loadedObjectStateGroup,
$groupUpdateStruct
);

$allObjectGroups = $objectStateService->loadObjectStateGroups();
/* END: Use Case */

$this->assertInstanceOf(
Expand All @@ -641,6 +646,7 @@ public function testUpdateObjectStateGroup()
$loadedObjectStateGroup,
$groupUpdateStruct,
$updatedObjectStateGroup,
$allObjectGroups,
);
}

Expand Down Expand Up @@ -747,13 +753,17 @@ public function testUpdateObjectStateGroupStructValues(array $testData)
list(
$loadedObjectStateGroup,
$groupUpdateStruct,
$updatedObjectStateGroup
$updatedObjectStateGroup,
$allObjectGroups
) = $testData;

$this->assertStructPropertiesCorrect(
$groupUpdateStruct,
$updatedObjectStateGroup
);

$this->assertContains($updatedObjectStateGroup, $allObjectGroups, '', false, false);
$this->assertNotContains($loadedObjectStateGroup, $allObjectGroups, '', false, false);
}

/**
Expand Down Expand Up @@ -1222,6 +1232,9 @@ public function testUpdateObjectState()
$objectStateId
);

// pre load any possile cache loading all
$objectStateService->loadObjectStates($loadedObjectState->getObjectStateGroup());

$updateStateStruct = $objectStateService->newObjectStateUpdateStruct();
$updateStateStruct->identifier = 'somehow_locked';
$updateStateStruct->defaultLanguageCode = 'ger-DE';
Expand All @@ -1238,6 +1251,8 @@ public function testUpdateObjectState()
$loadedObjectState,
$updateStateStruct
);

$allObjectStates = $objectStateService->loadObjectStates($loadedObjectState->getObjectStateGroup());
/* END: Use Case */

$this->assertInstanceOf(
Expand All @@ -1249,6 +1264,7 @@ public function testUpdateObjectState()
$loadedObjectState,
$updateStateStruct,
$updatedObjectState,
$allObjectStates,
);
}

Expand Down Expand Up @@ -1352,7 +1368,8 @@ public function testUpdateObjectStateStructValues(array $testData)
list(
$loadedObjectState,
$updateStateStruct,
$updatedObjectState
$updatedObjectState,
$allObjectStates
) = $testData;

$this->assertPropertiesCorrect(
Expand All @@ -1372,6 +1389,9 @@ public function testUpdateObjectStateStructValues(array $testData)
$loadedObjectState->getObjectStateGroup(),
$updatedObjectState->getObjectStateGroup()
);

$this->assertContains($updatedObjectState, $allObjectStates, '', false, false);
$this->assertNotContains($loadedObjectState, $allObjectStates, '', false, false);
}

/**
Expand Down

0 comments on commit c756bf9

Please sign in to comment.