From a9a2a256fa30bbbce694de34dd98d06ae7a9e822 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Fri, 6 Dec 2013 11:20:15 +0100 Subject: [PATCH] fix updatePositionDownTest --- core/lib/Thelia/Tests/Action/FolderTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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);