committed by
Julius Härtl
parent
5b30577df0
commit
fda8a03c43
@@ -105,7 +105,7 @@ class BoardImportCommandService extends BoardImportService {
|
||||
return $answer;
|
||||
});
|
||||
$configFile = $helper->ask($this->getInput(), $this->getOutput(), $question);
|
||||
$config = $this->getInput()->setOption('config', $configFile);
|
||||
$this->getInput()->setOption('config', $configFile);
|
||||
} catch (ConflictException $e) {
|
||||
$this->getOutput()->writeln('<error>Invalid config file</error>');
|
||||
$this->getOutput()->writeln(array_map(function (array $v): string {
|
||||
|
||||
@@ -34,21 +34,16 @@ use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Db\Label;
|
||||
use OCA\Deck\Db\LabelMapper;
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use OCA\Deck\Exceptions\ConflictException;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\Comments\IComment;
|
||||
use OCP\Comments\ICommentsManager;
|
||||
use OCP\Comments\NotFoundException as CommentNotFoundException;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IUserManager;
|
||||
|
||||
class BoardImportService {
|
||||
/** @var IDBConnection */
|
||||
protected $dbConn;
|
||||
/** @var IUserManager */
|
||||
private $userManager;
|
||||
/** @var BoardMapper */
|
||||
@@ -93,7 +88,6 @@ class BoardImportService {
|
||||
private $board;
|
||||
|
||||
public function __construct(
|
||||
IDBConnection $dbConn,
|
||||
IUserManager $userManager,
|
||||
BoardMapper $boardMapper,
|
||||
AclMapper $aclMapper,
|
||||
@@ -104,7 +98,6 @@ class BoardImportService {
|
||||
CardMapper $cardMapper,
|
||||
ICommentsManager $commentsManager
|
||||
) {
|
||||
$this->dbConn = $dbConn;
|
||||
$this->userManager = $userManager;
|
||||
$this->boardMapper = $boardMapper;
|
||||
$this->aclMapper = $aclMapper;
|
||||
@@ -253,14 +246,6 @@ class BoardImportService {
|
||||
$this->getBoard()->setLabels($labels);
|
||||
}
|
||||
|
||||
public function createLabel(string $title, string $color, int $boardId): Entity {
|
||||
$label = new Label();
|
||||
$label->setTitle($title);
|
||||
$label->setColor($color);
|
||||
$label->setBoardId($boardId);
|
||||
return $this->labelMapper->insert($label);
|
||||
}
|
||||
|
||||
public function importStacks(): void {
|
||||
$stacks = $this->getImportSystem()->getStacks();
|
||||
foreach ($stacks as $code => $stack) {
|
||||
|
||||
@@ -67,7 +67,6 @@ class BoardImportServiceTest extends \Test\TestCase {
|
||||
/** @var BoardImportService|MockObject */
|
||||
private $boardImportService;
|
||||
public function setUp(): void {
|
||||
$this->dbConn = $this->createMock(IDBConnection::class);
|
||||
$this->userManager = $this->createMock(IUserManager::class);
|
||||
$this->boardMapper = $this->createMock(BoardMapper::class);
|
||||
$this->aclMapper = $this->createMock(AclMapper::class);
|
||||
@@ -78,7 +77,6 @@ class BoardImportServiceTest extends \Test\TestCase {
|
||||
$this->attachmentMapper = $this->createMock(AttachmentMapper::class);
|
||||
$this->commentsManager = $this->createMock(ICommentsManager::class);
|
||||
$this->boardImportService = new BoardImportService(
|
||||
$this->dbConn,
|
||||
$this->userManager,
|
||||
$this->boardMapper,
|
||||
$this->aclMapper,
|
||||
|
||||
Reference in New Issue
Block a user