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

@@ -70,7 +70,7 @@ class FileServiceTest extends TestCase {
/** @var IConfig */
private $config;
public function setUp() {
public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
$this->appData = $this->createMock(IAppData::class);
@@ -161,10 +161,8 @@ class FileServiceTest extends TestCase {
$this->assertEquals($expected, $this->fileService->extendData($attachment));
}
/**
* @expectedException \Exception
*/
public function testCreateEmpty() {
$this->expectException(\Exception::class);
$attachment = $this->getAttachment();
$this->l10n->expects($this->any())
->method('t')
@@ -173,10 +171,8 @@ class FileServiceTest extends TestCase {
$this->fileService->create($attachment);
}
/**
* @expectedException \Exception
*/
public function testCreateError() {
$this->expectException(\Exception::class);
$attachment = $this->getAttachment();
$this->mockGetUploadedFileError(UPLOAD_ERR_INI_SIZE);
$this->l10n->expects($this->any())
@@ -221,11 +217,10 @@ class FileServiceTest extends TestCase {
$this->fileService->create($attachment);
}
/**
* @expectedException \Exception
* @expectedExceptionMessage File already exists.
*/
public function testCreateExists() {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('File already exists.');
$attachment = $this->getAttachment();
$this->mockGetUploadedFile();
$folder = $this->mockGetFolder(123);
@@ -336,4 +331,4 @@ class FileServiceTest extends TestCase {
$this->fileService->markAsDeleted($attachment);
$this->assertGreaterThan(0, $attachment->getDeletedAt());
}
}
}