From 1cb5b2deca2a010b95592939802f074ee58c833a Mon Sep 17 00:00:00 2001 From: David Matejka Date: Tue, 6 Oct 2015 11:28:14 +0200 Subject: [PATCH] added test for scope --- tests/src/SortableTestCase.phpt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/src/SortableTestCase.phpt b/tests/src/SortableTestCase.phpt index 6df26fc..e72891c 100644 --- a/tests/src/SortableTestCase.phpt +++ b/tests/src/SortableTestCase.phpt @@ -38,6 +38,22 @@ class SortableTestCase extends TestCase } + public function testScope() + { + $categories = []; + for ($i = 1; $i <= 6; $i++) { + $categories[$i] = $cat = new Category('Category ' . $i); + $cat->setSortableScope(['name']); + $this->em->persist($cat); + } + $this->em->flush(); + foreach ($categories as $category) { + Assert::equal(1, $category->getPosition()); + } + + } + + public function testPersistSetPosition() { $categories = $this->createCategories(); @@ -124,6 +140,7 @@ class SortableTestCase extends TestCase Assert::same(2, $categories[6]->getPosition()); } + public function testRemove() { $categories = $this->createCategories();