|
|
@ -4,7 +4,6 @@ namespace Drupal\Tests\islandora\Kernel; |
|
|
|
|
|
|
|
|
|
|
|
use Prophecy\PhpUnit\ProphecyTrait; |
|
|
|
use Prophecy\PhpUnit\ProphecyTrait; |
|
|
|
use GuzzleHttp\Psr7\Utils; |
|
|
|
use GuzzleHttp\Psr7\Utils; |
|
|
|
use function GuzzleHttp\Psr7\stream_for; |
|
|
|
|
|
|
|
use Drupal\Core\Logger\LoggerChannelInterface; |
|
|
|
use Drupal\Core\Logger\LoggerChannelInterface; |
|
|
|
use Drupal\islandora\Flysystem\Adapter\FedoraAdapter; |
|
|
|
use Drupal\islandora\Flysystem\Adapter\FedoraAdapter; |
|
|
|
use GuzzleHttp\Psr7\Response; |
|
|
|
use GuzzleHttp\Psr7\Response; |
|
|
@ -61,13 +60,8 @@ class FedoraAdapterTest extends IslandoraKernelTestBase { |
|
|
|
]); |
|
|
|
]); |
|
|
|
$prophecy->getHeader('Content-Type')->willReturn(['text/plain']); |
|
|
|
$prophecy->getHeader('Content-Type')->willReturn(['text/plain']); |
|
|
|
$prophecy->getHeader('Content-Length')->willReturn([strlen("DERP")]); |
|
|
|
$prophecy->getHeader('Content-Length')->willReturn([strlen("DERP")]); |
|
|
|
// phpcs:disable |
|
|
|
|
|
|
|
if (class_exists(Utils::class)) { |
|
|
|
|
|
|
|
$prophecy->getBody()->willReturn(Utils::streamFor("DERP")); |
|
|
|
$prophecy->getBody()->willReturn(Utils::streamFor("DERP")); |
|
|
|
} else { |
|
|
|
|
|
|
|
$prophecy->getBody()->willReturn(stream_for("DERP")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// phpcs:enable |
|
|
|
|
|
|
|
return $prophecy; |
|
|
|
return $prophecy; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -241,7 +235,7 @@ class FedoraAdapterTest extends IslandoraKernelTestBase { |
|
|
|
$head_prophecy = $this->prophesize(Response::class); |
|
|
|
$head_prophecy = $this->prophesize(Response::class); |
|
|
|
$head_prophecy->getStatusCode()->willReturn(410); |
|
|
|
$head_prophecy->getStatusCode()->willReturn(410); |
|
|
|
$head_prophecy->getHeader('Link') |
|
|
|
$head_prophecy->getHeader('Link') |
|
|
|
->willReturn('<some-path-to-a-tombstone>; rel="hasTombstone"'); |
|
|
|
->willReturn(['<some-path-to-a-tombstone>; rel="hasTombstone"']); |
|
|
|
|
|
|
|
|
|
|
|
$tombstone_prophecy = $this->prophesize(Response::class); |
|
|
|
$tombstone_prophecy = $this->prophesize(Response::class); |
|
|
|
$tombstone_prophecy->getStatusCode()->willReturn(204); |
|
|
|
$tombstone_prophecy->getStatusCode()->willReturn(204); |
|
|
@ -269,7 +263,7 @@ class FedoraAdapterTest extends IslandoraKernelTestBase { |
|
|
|
$head_prophecy = $this->prophesize(Response::class); |
|
|
|
$head_prophecy = $this->prophesize(Response::class); |
|
|
|
$head_prophecy->getStatusCode()->willReturn(410); |
|
|
|
$head_prophecy->getStatusCode()->willReturn(410); |
|
|
|
$head_prophecy->getHeader('Link') |
|
|
|
$head_prophecy->getHeader('Link') |
|
|
|
->willReturn('<some-path-to-a-tombstone>; rel="hasTombstone"'); |
|
|
|
->willReturn(['<some-path-to-a-tombstone>; rel="hasTombstone"']); |
|
|
|
|
|
|
|
|
|
|
|
$tombstone_prophecy = $this->prophesize(Response::class); |
|
|
|
$tombstone_prophecy = $this->prophesize(Response::class); |
|
|
|
$tombstone_prophecy->getStatusCode()->willReturn(500); |
|
|
|
$tombstone_prophecy->getStatusCode()->willReturn(500); |
|
|
|