diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php index 7ef88aa0d..c433411ee 100644 --- a/core/lib/Thelia/Tests/Action/FolderTest.php +++ b/core/lib/Thelia/Tests/Action/FolderTest.php @@ -162,14 +162,19 @@ class FolderTest extends BaseAction public function testUpdatePositionDown() { - $folder = FolderQuery::create() - ->filterByPosition(1) + $nextFolder = FolderQuery::create() + ->filterByPosition(2) ->findOne(); - if (null === $folder) { + if (null === $nextFolder) { $this->fail('use fixtures before launching test, there is no folder in database'); } + $folder = FolderQuery::create() + ->filterByPosition(1) + ->filterByParent($nextFolder->getParent()) + ->findOne(); + $newPosition = $folder->getPosition()+1; $event = new UpdatePositionEvent($folder->getId(), UpdatePositionEvent::POSITION_DOWN);