From f4a2f911e2a7d785f3048a85aefd860cfc81244f Mon Sep 17 00:00:00 2001 From: Holger Veltrup Date: Fri, 17 May 2024 14:08:31 +0200 Subject: [PATCH] test: fixes --- src/Service/Search/ExternalResourceFactory.php | 2 +- test/Console/Command/IndexerTest.php | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Service/Search/ExternalResourceFactory.php b/src/Service/Search/ExternalResourceFactory.php index 0ad9885..4b0eb75 100644 --- a/src/Service/Search/ExternalResourceFactory.php +++ b/src/Service/Search/ExternalResourceFactory.php @@ -65,7 +65,7 @@ private function getField( string $name, string $default = '' ): string { - $value = $document->getFields()[$name]; + $value = $document->getFields()[$name] ?? null; if ($value === null) { return $default; } diff --git a/test/Console/Command/IndexerTest.php b/test/Console/Command/IndexerTest.php index 6323846..0e04944 100644 --- a/test/Console/Command/IndexerTest.php +++ b/test/Console/Command/IndexerTest.php @@ -142,20 +142,15 @@ public function testExecuteWithoutIndexer(): void // the output of the command in the console $output = $commandTester->getDisplay(); - // phpcs:disable $this->assertEquals( <<