From 2abfeb957911a1eda622e6ef14b96f57bb6eaeb6 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Fri, 5 Aug 2022 15:08:19 +0200 Subject: fix more tests Signed-off-by: Benjamin Brahmer --- tests/Unit/Service/FeedServiceTest.php | 9 ++++----- tests/command/feeds.bats | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Unit/Service/FeedServiceTest.php b/tests/Unit/Service/FeedServiceTest.php index b237cff0a..632b8d6cc 100644 --- a/tests/Unit/Service/FeedServiceTest.php +++ b/tests/Unit/Service/FeedServiceTest.php @@ -173,10 +173,9 @@ class FeedServiceTest extends TestCase ->with($this->uid, $url) ->willReturn(new Feed()); - $this->fetcher->expects($this->never()) + $this->fetcher->expects($this->exactly(2)) ->method('fetch') - ->with($url) - ->will($this->throwException($ex)); + ->with($url); $this->expectException(ServiceConflictException::class); $this->expectExceptionMessage('Feed with this URL exists'); @@ -327,7 +326,7 @@ class FeedServiceTest extends TestCase $this->mapper->expects($this->once()) ->method('findByURL') - ->with($this->uid, $url) + ->with($this->uid, 'http://discover.test') ->will($this->throwException(new DoesNotExistException('no'))); $this->explorer->expects($this->once()) ->method('discover') @@ -443,7 +442,7 @@ class FeedServiceTest extends TestCase ->with($url) ->will($this->throwException(new ReadErrorException('ERROR'))); - $this->mapper->expects($this->once()) + $this->mapper->expects($this->never()) ->method('findByURL') ->with($this->uid, $url) ->will($this->throwException(new DoesNotExistException('no'))); diff --git a/tests/command/feeds.bats b/tests/command/feeds.bats index 6bebe469d..f89cd2afd 100644 --- a/tests/command/feeds.bats +++ b/tests/command/feeds.bats @@ -9,6 +9,7 @@ teardown() { for ID in $ID_LIST; do ./occ news:feed:delete "$user" "$ID" done + sleep 1 } @test "[$TESTSUITE] Create new" { -- cgit v1.2.3