Skip to content

Commit

Permalink
Fix logger mocking in BackendTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Feb 1, 2024
1 parent 2ab191f commit 95cf752
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use Laminas\EventManager\EventManager;
use Laminas\EventManager\SharedEventManager;
use PHPUnit\Framework\TestCase;
use VuFind\Log\Logger;
use Laminas\Log\LoggerInterface;
use VuFind\RecordDriver\EDS as EDSRecord;
use VuFind\RecordDriver\SolrMarc as SolrRecord;
use VuFindSearch\Backend\Blender\Backend;
Expand Down Expand Up @@ -814,17 +814,15 @@ public function testInvalidFilter(): void
$backend = $this->getBackend();
$params = $this->getSearchParams(['blender_backend:Foo']);

$logger = $this->getMockBuilder(Logger::class)
->disableOriginalConstructor()
->getMock();
$logger = $this->createMock(LoggerInterface::class);
$logger->expects($this->once())
->method('warn')
->with(
'VuFindSearch\Backend\Blender\Backend:'
. ' Invalid blender_backend filter: Backend Foo not enabled',
[]
)
->will($this->returnValue(null));
->willReturn(null);
$backend->setLogger($logger);
$backend->search(new Query(), 0, 20, $params);
}
Expand Down

0 comments on commit 95cf752

Please sign in to comment.