Remove interact from command and implement bootstrap method
Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
committed by
Julius Härtl
parent
e01e4cf1a7
commit
6714c89220
@@ -76,6 +76,22 @@ class BoardImportServiceTest extends \Test\TestCase {
|
||||
$this->assignmentMapper,
|
||||
$this->commentsManager
|
||||
);
|
||||
|
||||
$this->boardImportService->setSystem('trello');
|
||||
|
||||
$data = json_decode(file_get_contents(__DIR__ . '/../../data/data-trello.json'));
|
||||
$this->boardImportService->setData($data);
|
||||
|
||||
$configInstance = json_decode(file_get_contents(__DIR__ . '/../../data/config-trello.json'));
|
||||
$this->boardImportService->setConfigInstance($configInstance);
|
||||
|
||||
$owner = $this->createMock(IUser::class);
|
||||
$owner
|
||||
->method('getUID')
|
||||
->willReturn('admin');
|
||||
$this->userManager
|
||||
->method('get')
|
||||
->willReturn($owner);
|
||||
}
|
||||
|
||||
public function testImportSuccess() {
|
||||
@@ -91,25 +107,18 @@ class BoardImportServiceTest extends \Test\TestCase {
|
||||
}
|
||||
|
||||
public function testImportBoard() {
|
||||
$this->boardImportService->setSystem('trello');
|
||||
$data = json_decode(file_get_contents(__DIR__ . '/../../data/data-trello.json'));
|
||||
$this->boardImportService->setData($data);
|
||||
$configInstance = json_decode(file_get_contents(__DIR__ . '/../../data/config-trello.json'));
|
||||
$this->boardImportService->setConfigInstance($configInstance);
|
||||
|
||||
$owner = $this->createMock(IUser::class);
|
||||
$owner
|
||||
->method('getUID')
|
||||
->willReturn('owner');
|
||||
$this->userManager
|
||||
->method('get')
|
||||
->willReturn($owner);
|
||||
$this->boardImportService->validateOwner();
|
||||
$actual = $this->boardImportService->importBoard();
|
||||
$this->assertNull($actual);
|
||||
$board = $this->boardImportService->getBoard();
|
||||
$this->assertEquals('Test Board Name', $board->getTitle());
|
||||
$this->assertEquals('owner', $board->getOwner());
|
||||
$this->assertEquals('admin', $board->getOwner());
|
||||
$this->assertEquals('0800fd', $board->getColor());
|
||||
}
|
||||
|
||||
public function testImportAcl() {
|
||||
$this->markTestIncomplete();
|
||||
$actual = $this->boardImportService->importAcl();
|
||||
$this->assertNull($actual);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user