Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/Core/Command/Preview/RepairTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use OCP\Files\Node;
use OCP\IConfig;
use OCP\ILogger;
use OCP\Lock\ILockingProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -43,7 +44,13 @@ protected function setUp(): void {
->getMock();
$this->iniGetWrapper = $this->getMockBuilder(IniGetWrapper::class)
->getMock();
$this->repair = new Repair($this->config, $this->rootFolder, $this->logger, $this->iniGetWrapper);
$this->repair = new Repair(
$this->config,
$this->rootFolder,
$this->logger,
$this->iniGetWrapper,
$this->createMock(ILockingProvider::class)
);
$this->input = $this->getMockBuilder(InputInterface::class)
->getMock();
$this->input->expects($this->any())
Expand Down
2 changes: 2 additions & 0 deletions tests/Core/Controller/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ public function testLoginWithInvalidCredentials() {
->with('core.login.showLoginForm', [
'user' => $user,
'redirect_url' => '/apps/files',
'direct' => 1,
])
->willReturn($loginPageUrl);
$expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl);
Expand Down Expand Up @@ -597,6 +598,7 @@ public function testToNotLeakLoginName() {
->with('core.login.showLoginForm', [
'user' => '[email protected]',
'redirect_url' => '/apps/files',
'direct' => 1,
])
->willReturn($loginPageUrl);
$expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
/** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
private $userManager;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->rootFolder = $this->createMock(IRootFolder::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Test/Repair/Owncloud/CleanPreviewsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CleanPreviewsTest extends TestCase {
/** @var CleanPreviews */
private $repair;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->jobList = $this->createMock(IJobList::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Test/Repair/Owncloud/InstallCoreBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InstallCoreBundleTest extends TestCase {
/** @var InstallCoreBundle */
private $installCoreBundle;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->bundleFetcher = $this->createMock(BundleFetcher::class);
$this->config = $this->createMock(IConfig::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UpdateLanguageCodesTest extends TestCase {
/** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
private $config;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->connection = \OC::$server->getDatabaseConnection();
Expand Down Expand Up @@ -86,6 +86,7 @@ public function testRun() {
->from('preferences')
->where($qb->expr()->eq('appid', $qb->createNamedParameter('core')))
->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lang')))
->orderBy('userid')
->execute();

$rows = $result->fetchAll();
Expand Down
5 changes: 2 additions & 3 deletions tests/phpunit-autotest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
>
<testsuite name='ownCloud'>
<directory suffix='.php'>lib/</directory>
<directory suffix='.php'>core/</directory>
<directory suffix='.php'>ocs-provider/</directory>
<directory suffix='.php'>Core/</directory>
<directory suffix='.php'>Test/</directory>
<file>apps.php</file>
</testsuite>
<!-- filters for code coverage -->
Expand All @@ -32,4 +32,3 @@
<listener class="StartSessionListener" file="startsessionlistener.php" />
</listeners>
</phpunit>