Resolved unit tests errors, down from 36 to 9.

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-14 15:11:21 -04:00
committed by Julius Härtl
parent 881b05aeb1
commit e0049cf07b
2 changed files with 14 additions and 11 deletions

View File

@@ -151,7 +151,7 @@ class CardServiceTest extends TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('update');
$this->setExpectedException(StatusException::class);
$this->expectException(StatusException::class);
$this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null);
}
@@ -171,7 +171,7 @@ class CardServiceTest extends TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('update');
$this->setExpectedException(StatusException::class);
$this->expectException(StatusException::class);
$this->cardService->rename(123, 'newtitle');
}
@@ -211,7 +211,7 @@ class CardServiceTest extends TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('findAll')->willReturn([$card]);
$this->cardMapper->expects($this->never())->method('update')->willReturnCallback(function($c) { return $c; });
$this->setExpectedException(StatusException::class);
$this->expectException(StatusException::class);
$actual = $this->cardService->reorder(123, 234, 1);
}
public function testArchive() {
@@ -247,7 +247,7 @@ class CardServiceTest extends TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('assignLabel');
$this->setExpectedException(StatusException::class);
$this->expectException(StatusException::class);
$this->cardService->assignLabel(123, 999);
}
@@ -263,8 +263,8 @@ class CardServiceTest extends TestCase {
$card = new Card();
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('removeLabel');
$this->setExpectedException(StatusException::class);
$this->cardMapper->expects($this->never())->method('removeLabel');
$this->expectException(StatusException::class);
$this->cardService->removeLabel(123, 999);
}
@@ -320,7 +320,10 @@ class CardServiceTest extends TestCase {
}
/**
* @expectedException \OCA\Deck\NotFoundException
* @expectException \OCA\Deck\NotFoundException
*
*
*
*/
public function testUnassignUserNotExisting() {
$assignment = new AssignedUsers();