Skip to content

Commit

Permalink
update tests - copy paste from @dannylamb
Browse files Browse the repository at this point in the history
  • Loading branch information
elizoller committed Sep 10, 2020
1 parent 853ecec commit 291ebe0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ public function testMethodsReturnMillinerErrors()
$milliner = $this->prophesize(MillinerServiceInterface::class);
$milliner->saveNode(Argument::any(), Argument::any(), Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->getFileFromMedia(Argument::any(), Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->saveMedia(Argument::any(), Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->deleteNode(Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->saveExternal(Argument::any(), Argument::any(), Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->getGeminiUrls(Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner->createVersion(Argument::any(), Argument::any())
->willThrow(new \Exception("Forbidden", 403));
$milliner = $milliner->reveal();
Expand Down Expand Up @@ -473,6 +477,8 @@ public function testDeleteReturnsSuccessOnSuccess()
public function testCreateNodeVersionReturnsSuccessOnSuccess()
{
$milliner = $this->prophesize(MillinerServiceInterface::class);
$milliner->getGeminiUrls(Argument::any(), Argument::any())
->willReturn(['fedora' => "http://example.org/fcrepo/abc123", "drupal" => "http://example.org/node/1"]);
$milliner->createVersion(Argument::any(), Argument::any(), Argument::any(), Argument::any())
->willReturn(new Response(201));
$milliner = $milliner->reveal();
Expand All @@ -499,6 +505,8 @@ public function testCreateNodeVersionReturnsSuccessOnSuccess()
);

$milliner = $this->prophesize(MillinerServiceInterface::class);
$milliner->getGeminiUrls(Argument::any(), Argument::any())
->willReturn(['fedora' => "http://example.org/fcrepo/abc123", "drupal" => "http://example.org/node/1"]);
$milliner->createVersion(Argument::any(), Argument::any(), Argument::any(), Argument::any())
->willReturn(new Response(204));
$milliner = $milliner->reveal();
Expand Down

0 comments on commit 291ebe0

Please sign in to comment.