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

@@ -65,7 +65,7 @@ class ActivityManagerTest extends TestCase {
/** @var string */
private $userId = 'admin';
public function setUp() {
public function setUp(): void {
$this->manager = $this->createMock(IManager::class);
$this->permissionService = $this->createMock(PermissionService::class);
$this->boardMapper = $this->createMock(BoardMapper::class);
@@ -97,7 +97,7 @@ class ActivityManagerTest extends TestCase {
if (strpos($constant, 'SUBJECT') === 0) {
$format = $this->activityManager->getActivityFormat($value, [], false);
if ($format !== '') {
$this->assertContains('{user}', $format);
$this->assertStringContainsString('{user}', $format);
} else {
/** @noinspection ForgottenDebugOutputInspection */
print_r('No activity string found for '. $constant . PHP_EOL);

View File

@@ -28,7 +28,7 @@ use PHPUnit\Framework\TestCase;
class ChangeSetTest extends TestCase {
public function setUp() {
public function setUp(): void {
}
public function testChangeSetScalar() {

View File

@@ -56,7 +56,7 @@ class CommentEventHandlerTest extends TestCase {
/** @var CardMapper */
private $cardMapper;
public function setUp() {
public function setUp(): void {
$this->activityManager = $this->createMock(ActivityManager::class);
$this->notificationHelper = $this->createMock(NotificationHelper::class);
$this->cardMapper = $this->createMock(CardMapper::class);

View File

@@ -59,7 +59,7 @@ class DeckProviderTest extends TestCase {
/** @var string */
private $userId = 'admin';
public function setUp() {
public function setUp(): void {
$this->l10n = $this->createMock(IL10N::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->activityManager = $this->createMock(ActivityManager::class);
@@ -101,10 +101,8 @@ class DeckProviderTest extends TestCase {
return $event;
}
/**
* @expectedException \InvalidArgumentException
*/
public function testParseFailureApp() {
$this->expectException(\InvalidArgumentException::class);
$event = $this->createMock(IEvent::class);
$event->expects($this->once())->method('getApp')->willReturn('notdeck');
$this->provider->parse('en_US', $event, $event);

View File

@@ -39,7 +39,7 @@ class FilterTest extends TestCase {
/** @var IURLGenerator|MockObject */
private $urlGenerator;
public function setUp() {
public function setUp(): void {
$this->l10n = $this->createMock(IL10N::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->filter = new Filter($this->l10n, $this->urlGenerator);

View File

@@ -33,7 +33,7 @@ class SettingTest extends TestCase {
/** @var Setting */
private $setting;
public function setUp() {
public function setUp(): void {
$this->l10n = $this->createMock(IL10N::class);
$this->l10n->expects($this->any())->method('t')->will($this->returnCallback(function ($s) { return $s; }));
$this->setting = new Setting($this->l10n);