From 0e1f6d0ef0c17e0e668952fdbff970c213a5f389 Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 24 Oct 2020 22:48:53 +0100 Subject: [PATCH] add tests for parent/child search, to try and trigger #743 --- ext/relationships/test.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ext/relationships/test.php b/ext/relationships/test.php index 8b5eaf5a..6f083a42 100644 --- a/ext/relationships/test.php +++ b/ext/relationships/test.php @@ -74,6 +74,21 @@ class RelationshipsTest extends ShimmiePHPUnitTestCase return [$image_1, $image_2, $image_3]; } + /** + * @depends testSetParent + */ + public function testSearch($imgs) + { + [$image_1, $image_2, $image_3] = $this->testSetParent(null); + + $this->assert_search_results(["parent:any"], [$image_2->id]); + $this->assert_search_results(["parent:none"], [$image_3->id, $image_1->id]); + $this->assert_search_results(["parent:{$image_1->id}"], [$image_2->id]); + + $this->assert_search_results(["child:any"], [$image_1->id]); + $this->assert_search_results(["child:none"], [$image_3->id, $image_2->id]); + } + /** * @depends testChangeParent */