use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;
use GuzzleHttp\Client;
-use GuzzleHttp\Psr7\Response;
/**
* Tests the download process plugin.
* The local URI of the downloaded file.
*/
protected function doTransform($destination_uri, $configuration = []) {
- // The HTTP client will return a file with contents 'It worked!'
- $body = fopen('data://text/plain;base64,SXQgd29ya2VkIQ==', 'r');
-
// Prepare a mock HTTP client.
$this->container->set('http_client', $this->getMock(Client::class));
- $this->container->get('http_client')
- ->method('get')
- ->willReturn(new Response(200, [], $body));
// Instantiate the plugin statically so it can pull dependencies out of
// the container.