diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/app-files.feature | 13 | ||||
-rw-r--r-- | tests/lib/Accounts/AccountsManagerTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Accounts/HooksTest.php | 11 | ||||
-rw-r--r-- | tests/lib/Collaboration/Collaborators/UserPluginTest.php | 38 | ||||
-rw-r--r-- | tests/lib/Comments/FakeManager.php | 3 |
5 files changed, 38 insertions, 33 deletions
diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index 1117815ddab..793504443da 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -105,12 +105,13 @@ Feature: app-files # Then I see that the current section is "Favorites" # Then I see that the file list contains a file named "welcome.txt" - Scenario: show shares - Given I am logged in - And I share the link for "welcome.txt" - When I open the "Shares" section - Then I see that the current section is "Shares" - Then I see that the file list contains a file named "welcome.txt" +# TODO: disabled unreliable test +# Scenario: show shares +# Given I am logged in +# And I share the link for "welcome.txt" +# When I open the "Shares" section +# Then I see that the current section is "Shares" +# Then I see that the file list contains a file named "welcome.txt" # Scenario: show shares for a second time # Given I am logged in diff --git a/tests/lib/Accounts/AccountsManagerTest.php b/tests/lib/Accounts/AccountsManagerTest.php index 76abeb5b495..de9cc706b6a 100644 --- a/tests/lib/Accounts/AccountsManagerTest.php +++ b/tests/lib/Accounts/AccountsManagerTest.php @@ -25,9 +25,9 @@ use OC\Accounts\Account; use OC\Accounts\AccountManager; use OCP\Accounts\IAccountManager; use OCP\BackgroundJob\IJobList; -use OCP\ILogger; use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; use Test\TestCase; @@ -52,7 +52,7 @@ class AccountsManagerTest extends TestCase { /** @var string accounts table name */ private $table = 'accounts'; - /** @var ILogger|MockObject */ + /** @var LoggerInterface|MockObject */ private $logger; protected function setUp(): void { @@ -60,7 +60,7 @@ class AccountsManagerTest extends TestCase { $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class); $this->connection = \OC::$server->getDatabaseConnection(); $this->jobList = $this->createMock(IJobList::class); - $this->logger = $this->createMock(ILogger::class); + $this->logger = $this->createMock(LoggerInterface::class); } protected function tearDown(): void { diff --git a/tests/lib/Accounts/HooksTest.php b/tests/lib/Accounts/HooksTest.php index d24afd475e4..39003b2ef23 100644 --- a/tests/lib/Accounts/HooksTest.php +++ b/tests/lib/Accounts/HooksTest.php @@ -23,8 +23,9 @@ namespace Test\Accounts; use OC\Accounts\AccountManager; use OC\Accounts\Hooks; -use OCP\ILogger; use OCP\IUser; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Test\TestCase; /** @@ -35,19 +36,19 @@ use Test\TestCase; */ class HooksTest extends TestCase { - /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ + /** @var LoggerInterface|MockObject */ private $logger; - /** @var AccountManager | \PHPUnit\Framework\MockObject\MockObject */ + /** @var AccountManager|MockObject */ private $accountManager; - /** @var Hooks | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Hooks|MockObject */ private $hooks; protected function setUp(): void { parent::setUp(); - $this->logger = $this->createMock(ILogger::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->accountManager = $this->getMockBuilder(AccountManager::class) ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index cf2298d42f2..6b8861aedd4 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -151,13 +151,13 @@ class UserPluginTest extends TestCase { [ 'test', false, true, [], [], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, $this->getUserMock('test', 'Test'), ], [ 'test', false, false, [], [], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, $this->getUserMock('test', 'Test'), ], [ @@ -171,13 +171,13 @@ class UserPluginTest extends TestCase { [ 'test', true, true, ['test-group'], [['test-group', 'test', 2, 0, []]], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, $this->getUserMock('test', 'Test'), ], [ 'test', true, false, ['test-group'], [['test-group', 'test', 2, 0, []]], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, $this->getUserMock('test', 'Test'), ], [ @@ -190,7 +190,7 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], true, false, @@ -219,8 +219,8 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], false, false, @@ -250,11 +250,11 @@ class UserPluginTest extends TestCase { $this->getUserMock('test2', 'Test Two'), ], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], false, false, @@ -270,7 +270,7 @@ class UserPluginTest extends TestCase { $this->getUserMock('test2', 'Test Two'), ], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, @@ -287,7 +287,7 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], true, false, @@ -325,8 +325,8 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], true, false, @@ -373,10 +373,10 @@ class UserPluginTest extends TestCase { ]], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [ - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], false, false, @@ -399,7 +399,7 @@ class UserPluginTest extends TestCase { ]], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], ], [], true, @@ -618,10 +618,10 @@ class UserPluginTest extends TestCase { }, $matchingUsers); $mappedResultExact = array_map(function ($user) { - return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'status' => []]; + return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => []]; }, $result['exact']); $mappedResultWide = array_map(function ($user) { - return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'status' => []]; + return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => []]; }, $result['wide']); $this->userManager->expects($this->once()) diff --git a/tests/lib/Comments/FakeManager.php b/tests/lib/Comments/FakeManager.php index b165b01c3c2..91c8d4b7d58 100644 --- a/tests/lib/Comments/FakeManager.php +++ b/tests/lib/Comments/FakeManager.php @@ -83,4 +83,7 @@ class FakeManager implements ICommentsManager { public function getActorsInTree($id) { } + + public function load(): void { + } } |