Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
janette committed Jan 3, 2023
1 parent f8d9deb commit 744276d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

24 changes: 24 additions & 0 deletions test/Processor/RemoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

use Contracts\Mock\Storage\Memory;
use FileFetcher\FileFetcher;
use FileFetcher\PhpFunctionsBridge;
use FileFetcher\Processor\Remote;
use FileFetcherTests\Mock\FakeRemote;
use MockChain\Chain;
use MockChain\Options;
use PHPUnit\Framework\TestCase;
use Procrastinator\Result;

Expand All @@ -30,6 +33,27 @@ public function testCopyAFileWithRemoteProcessor()
$this->assertEquals($result->getStatus(), Result::DONE);
}

public function testCurlCopy()
{
$options = (new Options())
->add('curl_exec', "")
->index(0);

$bridge = (new Chain($this))
->add(PhpFunctionsBridge::class, '__call', $options)
->getMock();

$processor = new Remote();
$processor->setPhpFunctionsBridge($bridge);
$processor->copy([
'source' => 'hello',
'destination' => 'goodbye',
'total_bytes_copied' => 1,
'total_bytes' => 10,
], new Result());
$this->assertTrue(true);
}

/**
* Test the \FileFetcher\Processor\Remote::isServerCompatible() method.
*/
Expand Down

0 comments on commit 744276d

Please sign in to comment.