add tests for parent/child search, to try and trigger #743

This commit is contained in:
Shish 2020-10-24 22:48:53 +01:00
parent 7f37607d9d
commit 0e1f6d0ef0

View file

@ -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
*/