From 39f5e9cdbe302be7bef90a2b3ebf5c846b6e08dc Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Sat, 6 Aug 2022 10:17:05 +0200 Subject: Rewrite unit-test Signed-off-by: Benjamin Brahmer --- tests/Unit/Service/FeedServiceTest.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/Unit/Service/FeedServiceTest.php b/tests/Unit/Service/FeedServiceTest.php index 632b8d6cc..f0c367b7a 100644 --- a/tests/Unit/Service/FeedServiceTest.php +++ b/tests/Unit/Service/FeedServiceTest.php @@ -165,20 +165,14 @@ class FeedServiceTest extends TestCase public function testCreateDoesNotFindFeed() { - $ex = new ReadErrorException('hi'); $url = 'test'; - $this->mapper->expects($this->once()) - ->method('findByURL') - ->with($this->uid, $url) - ->willReturn(new Feed()); - $this->fetcher->expects($this->exactly(2)) ->method('fetch') - ->with($url); + ->with($url) + ->will($this->throwException(new ReadErrorException('There is no feed'))); - $this->expectException(ServiceConflictException::class); - $this->expectExceptionMessage('Feed with this URL exists'); + $this->expectException(ServiceNotFoundException::class); $this->class->create($this->uid, $url, 1); } -- cgit v1.2.3