Fix more tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-11-22 13:23:56 +01:00
parent f2ef35dbf1
commit 8d4346d656
No known key found for this signature in database
GPG Key ID: F941078878347C0C
6 changed files with 66 additions and 43 deletions

View File

@ -194,7 +194,7 @@ class FileTest extends TestCase {
} else { } else {
$storage->expects($this->once()) $storage->expects($this->once())
->method('writeStream') ->method('writeStream')
->will($this->returnValue(false)); ->will($this->returnValue(0));
} }
$view->expects($this->any()) $view->expects($this->any())

View File

@ -221,7 +221,7 @@ class ShareAPIControllerTest extends TestCase {
$share = $this->newShare(); $share = $this->newShare();
$share->setNode($node); $share->setNode($node);
$this->shareManager $this->shareManager
->expects($this->once()) ->expects($this->once())
->method('getShareById') ->method('getShareById')
@ -237,7 +237,7 @@ class ShareAPIControllerTest extends TestCase {
->method('lock') ->method('lock')
->with(\OCP\Lock\ILockingProvider::LOCK_SHARED) ->with(\OCP\Lock\ILockingProvider::LOCK_SHARED)
->will($this->throwException(new LockedException('mypath'))); ->will($this->throwException(new LockedException('mypath')));
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share]));
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -245,7 +245,7 @@ class ShareAPIControllerTest extends TestCase {
} }
/** /**
* You can always remove a share that was shared with you * You can always remove a share that was shared with you
*/ */
public function testDeleteShareWithMe() { public function testDeleteShareWithMe() {
$node = $this->getMockBuilder(File::class)->getMock(); $node = $this->getMockBuilder(File::class)->getMock();
@ -254,7 +254,7 @@ class ShareAPIControllerTest extends TestCase {
$share->setSharedWith($this->currentUser) $share->setSharedWith($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_USER) ->setShareType(\OCP\Share::SHARE_TYPE_USER)
->setNode($node); ->setNode($node);
$this->shareManager $this->shareManager
->expects($this->once()) ->expects($this->once())
->method('getShareById') ->method('getShareById')
@ -269,7 +269,7 @@ class ShareAPIControllerTest extends TestCase {
$node->expects($this->once()) $node->expects($this->once())
->method('lock') ->method('lock')
->with(\OCP\Lock\ILockingProvider::LOCK_SHARED); ->with(\OCP\Lock\ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share]));
$this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -300,7 +300,7 @@ class ShareAPIControllerTest extends TestCase {
$node->expects($this->once()) $node->expects($this->once())
->method('lock') ->method('lock')
->with(\OCP\Lock\ILockingProvider::LOCK_SHARED); ->with(\OCP\Lock\ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share]));
$this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -332,7 +332,7 @@ class ShareAPIControllerTest extends TestCase {
$node->expects($this->once()) $node->expects($this->once())
->method('lock') ->method('lock')
->with(\OCP\Lock\ILockingProvider::LOCK_SHARED); ->with(\OCP\Lock\ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteFromSelf', [$share]));
$this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -388,10 +388,10 @@ class ShareAPIControllerTest extends TestCase {
$this->shareManager->expects($this->once()) $this->shareManager->expects($this->once())
->method('deleteFromSelf') ->method('deleteFromSelf')
->with($share, $this->currentUser); ->with($share, $this->currentUser);
$this->shareManager->expects($this->never()) $this->shareManager->expects($this->never())
->method('deleteShare'); ->method('deleteShare');
$this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShareFromSelf', [$share])); $this->assertTrue($this->invokePrivate($this->ocs, 'canDeleteShareFromSelf', [$share]));
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -448,10 +448,10 @@ class ShareAPIControllerTest extends TestCase {
$this->shareManager->expects($this->never()) $this->shareManager->expects($this->never())
->method('deleteFromSelf'); ->method('deleteFromSelf');
$this->shareManager->expects($this->never()) $this->shareManager->expects($this->never())
->method('deleteShare'); ->method('deleteShare');
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShareFromSelf', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShareFromSelf', [$share]));
$this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share])); $this->assertFalse($this->invokePrivate($this->ocs, 'canDeleteShare', [$share]));
@ -1602,7 +1602,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1634,7 +1634,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1682,7 +1682,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1736,7 +1736,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1791,7 +1791,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1843,7 +1843,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1875,7 +1875,7 @@ class ShareAPIControllerTest extends TestCase {
])); ]));
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1894,7 +1894,7 @@ class ShareAPIControllerTest extends TestCase {
*/ */
public function testCreateShareLinkNoPublicUpload() { public function testCreateShareLinkNoPublicUpload() {
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1914,7 +1914,7 @@ class ShareAPIControllerTest extends TestCase {
*/ */
public function testCreateShareLinkPublicUploadFile() { public function testCreateShareLinkPublicUploadFile() {
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1933,7 +1933,7 @@ class ShareAPIControllerTest extends TestCase {
$ocs = $this->mockFormatShare(); $ocs = $this->mockFormatShare();
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -1967,7 +1967,7 @@ class ShareAPIControllerTest extends TestCase {
$ocs = $this->mockFormatShare(); $ocs = $this->mockFormatShare();
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2001,7 +2001,7 @@ class ShareAPIControllerTest extends TestCase {
$ocs = $this->mockFormatShare(); $ocs = $this->mockFormatShare();
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2042,7 +2042,7 @@ class ShareAPIControllerTest extends TestCase {
$ocs = $this->mockFormatShare(); $ocs = $this->mockFormatShare();
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2076,7 +2076,7 @@ class ShareAPIControllerTest extends TestCase {
])); ]));
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2117,7 +2117,7 @@ class ShareAPIControllerTest extends TestCase {
$ocs = $this->mockFormatShare(); $ocs = $this->mockFormatShare();
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2145,7 +2145,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2227,7 +2227,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2268,7 +2268,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(File::class)->getMock(); $path = $this->getMockBuilder(File::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(false); ->willReturn(false);
@ -2345,7 +2345,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($userFolder); ->willReturn($userFolder);
$path = $this->getMockBuilder(Folder::class)->getMock(); $path = $this->getMockBuilder(Folder::class)->getMock();
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('instanceOfStorage') $storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage') ->with('OCA\Files_Sharing\External\Storage')
->willReturn(true); ->willReturn(true);
@ -3381,7 +3381,7 @@ class ShareAPIControllerTest extends TestCase {
$cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock(); $cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock();
$cache->method('getNumericStorageId')->willReturn(100); $cache->method('getNumericStorageId')->willReturn(100);
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('getId')->willReturn('storageId'); $storage->method('getId')->willReturn('storageId');
$storage->method('getCache')->willReturn($cache); $storage->method('getCache')->willReturn($cache);
@ -4150,7 +4150,7 @@ class ShareAPIControllerTest extends TestCase {
$cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock(); $cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock();
$cache->method('getNumericStorageId')->willReturn(100); $cache->method('getNumericStorageId')->willReturn(100);
$storage = $this->getMockBuilder(Storage::class)->getMock(); $storage = $this->createMock(Storage::class);
$storage->method('getId')->willReturn('storageId'); $storage->method('getId')->willReturn('storageId');
$storage->method('getCache')->willReturn($cache); $storage->method('getCache')->willReturn($cache);

View File

@ -35,6 +35,7 @@ use OCA\Files_Sharing\Tests\TestCase;
use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager; use OCP\Federation\ICloudFederationProviderManager;
use OCP\Http\Client\IClientService; use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
use OCP\IGroupManager; use OCP\IGroupManager;
use OCP\IUserManager; use OCP\IUserManager;
use Test\Traits\UserTrait; use Test\Traits\UserTrait;
@ -172,8 +173,15 @@ class ManagerTest extends TestCase {
$this->clientService->expects($this->at(0)) $this->clientService->expects($this->at(0))
->method('newClient') ->method('newClient')
->willReturn($client); ->willReturn($client);
$response = $this->getMockBuilder('OCP\Http\Client\IResponse') $response = $this->createMock(IResponse::class);
->disableOriginalConstructor()->getMock(); $response->method('getBody')
->willReturn(json_encode([
'ocs' => [
'meta' => [
'statuscode' => 200,
]
]
]));
$client->expects($this->once()) $client->expects($this->once())
->method('post') ->method('post')
->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id']), $this->anything()) ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id']), $this->anything())
@ -215,8 +223,15 @@ class ManagerTest extends TestCase {
$this->clientService->expects($this->at(0)) $this->clientService->expects($this->at(0))
->method('newClient') ->method('newClient')
->willReturn($client); ->willReturn($client);
$response = $this->getMockBuilder('OCP\Http\Client\IResponse') $response = $this->createMock(IResponse::class);
->disableOriginalConstructor()->getMock(); $response->method('getBody')
->willReturn(json_encode([
'ocs' => [
'meta' => [
'statuscode' => 200,
]
]
]));
$client->expects($this->once()) $client->expects($this->once())
->method('post') ->method('post')
->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[1]['remote_id'] . '/decline'), $this->anything()) ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[1]['remote_id'] . '/decline'), $this->anything())
@ -255,8 +270,15 @@ class ManagerTest extends TestCase {
$this->clientService->expects($this->at(1)) $this->clientService->expects($this->at(1))
->method('newClient') ->method('newClient')
->willReturn($client2); ->willReturn($client2);
$response = $this->getMockBuilder('OCP\Http\Client\IResponse') $response = $this->createMock(IResponse::class);
->disableOriginalConstructor()->getMock(); $response->method('getBody')
->willReturn(json_encode([
'ocs' => [
'meta' => [
'statuscode' => 200,
]
]
]));
$client1->expects($this->once()) $client1->expects($this->once())
->method('post') ->method('post')
->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id'] . '/decline'), $this->anything()) ->with($this->stringStartsWith('http://localhost/ocs/v2.php/cloud/shares/' . $openShares[0]['remote_id'] . '/decline'), $this->anything())

View File

@ -503,7 +503,7 @@ class ShareByMailProviderTest extends TestCase {
* @param string newSendPasswordByTalk * @param string newSendPasswordByTalk
* @param bool sendMail * @param bool sendMail
*/ */
public function testUpdateSendPassword($plainTextPassword, string $originalPassword, string $newPassword, string $originalSendPasswordByTalk, string $newSendPasswordByTalk, bool $sendMail) { public function testUpdateSendPassword($plainTextPassword, string $originalPassword, string $newPassword, $originalSendPasswordByTalk, $newSendPasswordByTalk, bool $sendMail) {
$node = $this->getMockBuilder(File::class)->getMock(); $node = $this->getMockBuilder(File::class)->getMock();
$node->expects($this->any())->method('getName')->willReturn('filename'); $node->expects($this->any())->method('getName')->willReturn('filename');

View File

@ -32,6 +32,7 @@ use OCA\User_LDAP\Access;
use OCA\User_LDAP\Configuration; use OCA\User_LDAP\Configuration;
use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\ILDAPWrapper;
use OCA\User_LDAP\Wizard; use OCA\User_LDAP\Wizard;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase; use Test\TestCase;
/** /**
@ -80,7 +81,7 @@ class WizardTest extends TestCase {
return array(new Wizard($conf, $lw, $access), $conf, $lw, $access); return array(new Wizard($conf, $lw, $access), $conf, $lw, $access);
} }
private function prepareLdapWrapperForConnections(\PHPUnit_Framework_MockObject_MockObject &$ldap) { private function prepareLdapWrapperForConnections(MockObject &$ldap) {
$ldap->expects($this->once()) $ldap->expects($this->once())
->method('connect') ->method('connect')
//dummy value, usually invalid //dummy value, usually invalid

View File

@ -336,7 +336,7 @@ class ManagerTest extends \Test\TestCase {
$this->defaultProvider $this->defaultProvider
->method('delete') ->method('delete')
->withConsecutive($share3, $share2, $share1); ->withConsecutive([$share3], [$share2], [$share1]);
$this->eventDispatcher->expects($this->at(0)) $this->eventDispatcher->expects($this->at(0))
->method('dispatch') ->method('dispatch')
@ -427,7 +427,7 @@ class ManagerTest extends \Test\TestCase {
$this->defaultProvider $this->defaultProvider
->expects($this->exactly(3)) ->expects($this->exactly(3))
->method('delete') ->method('delete')
->withConsecutive($child1, $child2, $child3); ->withConsecutive([$child1], [$child2], [$child3]);
$result = self::invokePrivate($manager, 'deleteChildren', [$share]); $result = self::invokePrivate($manager, 'deleteChildren', [$share]);
$this->assertSame($shares, $result); $this->assertSame($shares, $result);