tests: Fix url generation mocks and cleanup some phpunit code

Signed-off-by: Julius Knorr <jus@bitgrid.net>
This commit is contained in:
Julius Knorr
2025-01-17 10:59:25 +01:00
committed by backportbot[bot]
parent 81c8aad66f
commit e9e5234925
11 changed files with 33 additions and 27 deletions

View File

@@ -284,7 +284,7 @@ class ActivityManagerTest extends TestCase {
$this->assertEquals($event, $actual);
}
public function dataSendToUsers() {
public static function dataSendToUsers() {
return [
[ActivityManager::DECK_OBJECT_BOARD],
[ActivityManager::DECK_OBJECT_CARD],
@@ -344,7 +344,7 @@ class ActivityManagerTest extends TestCase {
$this->invokePrivate($this->activityManager, 'sendToUsers', [$event]);
}
public function dataFindObjectForEntity() {
public static function dataFindObjectForEntity() {
$board = new Board();
$board->setId(1);
$stack = new Stack();

View File

@@ -123,7 +123,7 @@ class DeckProviderTest extends TestCase {
$this->provider->parse('en_US', $event, $event);
}
public function dataEventIcons() {
public static function dataEventIcons() {
return [
[ActivityManager::SUBJECT_LABEL_ASSIGN, 'core', 'actions/tag.svg'],
[ActivityManager::SUBJECT_CARD_CREATE, 'files', 'add-color.svg'],
@@ -166,7 +166,7 @@ class DeckProviderTest extends TestCase {
->with('deck.page.index')
->willReturn('http://localhost/index.php/apps/deck/');
$this->assertEquals(
'http://localhost/index.php/apps/deck/#board/1/card/1',
'http://localhost/index.php/apps/deck/board/1/card/1',
$this->provider->deckUrl('board/1/card/1')
);
}
@@ -202,7 +202,7 @@ class DeckProviderTest extends TestCase {
'type' => 'highlight',
'id' => 1,
'name' => 'Board',
'link' => '#/board/1',
'link' => 'board/1',
],
'user' => [
'type' => 'user',
@@ -319,9 +319,9 @@ class DeckProviderTest extends TestCase {
$expected = [
'board' => [
'type' => 'highlight',
'id' => 1,
'id' => '1',
'name' => 'Board name',
'link' => '#/board/1/',
'link' => 'board/1',
],
];
$actual = $this->invokePrivate($this->provider, 'parseParamForBoard', ['board', $subjectParams, $params]);