Skip to content

Commit

Permalink
thephpleague#98: Fixed Mockery 0.9.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
proggeler committed Dec 19, 2019
1 parent cd82c9a commit d755eab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/SftpAdapterTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,17 @@ public function testRename($filesystem, $adapter, $mock)
'size' => 20,
'permissions' => 0777,
]);
$mock->shouldReceive('mkdir')->never()->with('.', $adapter->getDirectoryPerm(), true);

$mock->shouldReceive('rename')->andReturn(true);
$result = $filesystem->rename('old', 'new');
$this->assertTrue($result);
$mock->shouldNotHaveReceived('mkdir');
}

/**
* @dataProvider adapterProvider
*
* @param \Mockery\MockInterface $mock
*/
public function testRenameCreatesDirectory($filesystem, $adapter, $mock)
{
Expand All @@ -212,11 +214,11 @@ public function testRenameCreatesDirectory($filesystem, $adapter, $mock)
]);
$mock->shouldReceive('stat')->with('new_dir/file.ext')->andReturn(false);
$mock->shouldReceive('stat')->with('new_dir')->andReturn(false);
$mock->shouldReceive('mkdir')->once()->with('new_dir', $adapter->getDirectoryPerm(), true);

$mock->shouldReceive('rename')->andReturn(true);
$result = $filesystem->rename('old_dir/file.ext', 'new_dir/file.ext');
$this->assertTrue($result);
$mock->shouldHaveReceived('mkdir');
}

/**
Expand Down

0 comments on commit d755eab

Please sign in to comment.