Bump phpunit and fix CI

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-12-17 11:54:45 +01:00
parent f575202a8a
commit 4c0512f0b7
42 changed files with 159 additions and 209 deletions

View File

@@ -35,17 +35,17 @@ class StackApiControllerTest extends \Test\TestCase {
private $appName = 'deck';
private $userId = 'admin';
private $controller;
private $controller;
private $boardService;
private $stackService;
private $exampleStack;
private $exampleBoard;
public function setUp() {
public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
$this->boardService = $this->createMock(BoardService::class);
$this->stackService = $this->createMock(StackService::class);
$this->stackService = $this->createMock(StackService::class);
$this->exampleStack['id'] = 345;
$this->exampleStack['boardId'] = $this->exampleBoard['boardId'];
@@ -67,7 +67,7 @@ class StackApiControllerTest extends \Test\TestCase {
$stack->setId($this->exampleStack['id']);
$stack->setBoardId($this->exampleStack['boardId']);
$stack->setOrder($this->exampleStack['order']);
$stacks = [$stack];
$stacks = [$stack];
$this->stackService->expects($this->once())
->method('findAll')
@@ -87,7 +87,7 @@ class StackApiControllerTest extends \Test\TestCase {
$stack = new Stack();
$stack->setId($this->exampleStack['id']);
$stack->setBoardId($this->exampleStack['boardId']);
$stack->setOrder($this->exampleStack['order']);
$stack->setOrder($this->exampleStack['order']);
$this->stackService->expects($this->once())
->method('find')
@@ -96,12 +96,12 @@ class StackApiControllerTest extends \Test\TestCase {
$this->request->expects($this->once())
->method('getParam')
->with('stackId')
->willReturn($this->exampleStack['id']);
->willReturn($this->exampleStack['id']);
$expected = new DataResponse($stack, HTTP::STATUS_OK);
$actual = $this->controller->get();
$this->assertEquals($expected, $actual);
}
}
public function testCreate() {
@@ -126,8 +126,8 @@ class StackApiControllerTest extends \Test\TestCase {
}
public function testUpdate() {
$this->request->expects($this->exactly(2))
$this->request->expects($this->exactly(2))
->method('getParam')
->withConsecutive(
['stackId'],
@@ -171,4 +171,4 @@ class StackApiControllerTest extends \Test\TestCase {
$actual = $this->controller->delete();
$this->assertEquals($expected, $actual);
}
}
}