Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.15] Update tests to v1.15 #237

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/php-test-master.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: PHP Codeception Tests - master

on:
push:

jobs:
tests:
uses: humhub/actions/.github/workflows/module-tests-master.yml@main
with:
module-id: tasks
use-rest-module: true
name: PHP Codeception Tests - master

on:
push:
schedule:
- cron: "0 0 * * 0"

jobs:
tests:
uses: humhub/actions/.github/workflows/module-tests-master.yml@main
with:
module-id: tasks
use-rest-module: true
13 changes: 13 additions & 0 deletions .github/workflows/php-test-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PHP Codeception Tests - next

on:
push:
schedule:
- cron: "0 0 * * 0"

jobs:
tests:
uses: humhub/actions/.github/workflows/module-tests-next.yml@main
with:
module-id: tasks
use-rest-module: true
13 changes: 13 additions & 0 deletions .github/workflows/php-test-v1.14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PHP Codeception Tests - v1.14

on:
push:
schedule:
- cron: "0 0 * * 0"

jobs:
tests:
uses: humhub/actions/.github/workflows/module-tests-v1.14.yml@main
with:
module-id: tasks
use-rest-module: true
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.8.3 (Unreleased)
-------------------
- Fix #237: Update tests for compatibility with v1.15

1.8.2 (Unreleased)
-------------------
- Fix #232: Set All Icons color to @text-color-main (#555)
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Tasks",
"description": "Intuitive task management tool with many basic and advanced features.",
"keywords": ["task", "todo"],
"version": "1.8.2",
"version": "1.8.3",
"homepage": "https://github.com/humhub/tasks",
"humhub": {
"minVersion": "1.14"
Expand Down
34 changes: 1 addition & 33 deletions tests/codeception/_support/TaskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\models\Content;
use humhub\modules\notification\models\Notification;
use humhub\modules\tasks\models\Task;
use humhub\modules\tasks\models\lists\TaskList;
use tests\codeception\_support\HumHubDbTestCase;
use yii\db\ActiveRecord;

class TaskTestCase extends HumHubDbTestCase
{
Expand Down Expand Up @@ -38,34 +36,4 @@ public function createTask(ContentContainerActiveRecord $contentContainer, $titl
$task->refresh();
return $task;
}

public function assertHasNoNotification($class, ActiveRecord $source, $originator_id = null, $target_id = null, $msg = '')
{
$notificationQuery = Notification::find()->where(['class' => $class, 'source_class' => $source->className(), 'source_pk' => $source->getPrimaryKey()]);

if ($originator_id != null) {
$notificationQuery->andWhere(['originator_user_id' => $originator_id]);
}

if($target_id != null) {
$notificationQuery->andWhere(['user_id' => $target_id]);
}

$this->assertEmpty($notificationQuery->all(), $msg);
}

public function assertEqualsNotificationCount($count, $class, ActiveRecord $source, $originator_id = null, $target_id = null, $msg = '')
{
$notificationQuery = Notification::find()->where(['class' => $class, 'source_class' => $source->className(), 'source_pk' => $source->getPrimaryKey()]);

if ($originator_id != null) {
$notificationQuery->andWhere(['originator_user_id' => $originator_id]);
}

if($target_id != null) {
$notificationQuery->andWhere(['user_id' => $target_id]);
}

$this->assertEquals($count, $notificationQuery->count(), $msg);
}
}
}