diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php
index 7aa7e774ddb4d96fd63451b98672a6ab584e04d4..2ee0ba6e3d8da4c9759420ebcf21893751950210 100644
--- a/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php
+++ b/module/VuFind/tests/unit-tests/src/VuFindTest/View/Helper/Root/RecordTest.php
@@ -256,8 +256,11 @@ class RecordTest extends \PHPUnit\Framework\TestCase
     public function testGetLink()
     {
         $context = $this->getMockContext();
+        $callback = function ($arr) {
+            return $arr['lookfor'] === 'foo';
+        };
         $context->expects($this->once())->method('apply')
-            ->with($this->equalTo(['lookfor' => 'foo']))
+            ->with($this->callback($callback))
             ->will($this->returnValue(['bar' => 'baz']));
         $context->expects($this->once())->method('restore')
             ->with($this->equalTo(['bar' => 'baz']));