UPSTREAM BASELINE: nextcloud/spreed v22.0.12 (без изменений)
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled
Type checking / changes (push) Has been cancelled
Type checking / test (push) Has been cancelled
Type checking / typescript-summary (push) Has been cancelled
Node tests / changes (push) Has been cancelled
Node tests / test (push) Has been cancelled
Node tests / test-summary (push) Has been cancelled
Источник: https://github.com/nextcloud/spreed/archive/refs/tags/v22.0.12.tar.gz С этого коммита ветка официального Nextcloud Talk отрезана (решение владельца 2026-07-06). Все дальнейшие изменения — только наши; версии релизов: 22.0.12-f7.N.
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCA\Talk\Tests\php\Command\Turn;
|
||||
|
||||
use OCA\Talk\Command\Turn\ListCommand;
|
||||
use OCP\IConfig;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Test\TestCase;
|
||||
|
||||
class ListCommandTest extends TestCase {
|
||||
protected IConfig&MockObject $config;
|
||||
protected InputInterface&MockObject $input;
|
||||
protected OutputInterface&MockObject $output;
|
||||
protected ListCommand&MockObject $command;
|
||||
|
||||
public function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->config = $this->createMock(IConfig::class);
|
||||
|
||||
$this->command = $this->getMockBuilder(ListCommand::class)
|
||||
->setConstructorArgs([$this->config])
|
||||
->onlyMethods(['writeMixedInOutputFormat'])
|
||||
->getMock();
|
||||
|
||||
$this->input = $this->createMock(InputInterface::class);
|
||||
$this->output = $this->createMock(OutputInterface::class);
|
||||
}
|
||||
|
||||
public function testEmptyAppConfig(): void {
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('spreed', 'turn_servers')
|
||||
->willReturn(json_encode([]));
|
||||
|
||||
$this->command->expects($this->once())
|
||||
->method('writeMixedInOutputFormat')
|
||||
->with(
|
||||
$this->equalTo($this->input),
|
||||
$this->equalTo($this->output),
|
||||
$this->equalTo([])
|
||||
);
|
||||
|
||||
self::invokePrivate($this->command, 'execute', [$this->input, $this->output]);
|
||||
}
|
||||
|
||||
public function testAppConfigDataChanges(): void {
|
||||
$this->config->expects($this->once())
|
||||
->method('getAppValue')
|
||||
->with('spreed', 'turn_servers')
|
||||
->willReturn(json_encode([
|
||||
[
|
||||
'server' => 'turn1.test.com',
|
||||
'secret' => 'my-sercret-1',
|
||||
'protocols' => 'tcp',
|
||||
],
|
||||
[
|
||||
'server' => 'turn2.test.com',
|
||||
'secret' => 'my-sercret-2',
|
||||
'protocols' => 'udp,tcp',
|
||||
],
|
||||
]));
|
||||
|
||||
$this->command->expects($this->once())
|
||||
->method('writeMixedInOutputFormat')
|
||||
->with(
|
||||
$this->equalTo($this->input),
|
||||
$this->equalTo($this->output),
|
||||
$this->equalTo([
|
||||
[
|
||||
'server' => 'turn1.test.com',
|
||||
'secret' => 'my-sercret-1',
|
||||
'protocols' => 'tcp',
|
||||
],
|
||||
[
|
||||
'server' => 'turn2.test.com',
|
||||
'secret' => 'my-sercret-2',
|
||||
'protocols' => 'udp,tcp',
|
||||
],
|
||||
])
|
||||
);
|
||||
|
||||
self::invokePrivate($this->command, 'execute', [$this->input, $this->output]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user