Skip to content

Commit 665580d

Browse files
authored
Merge pull request #210 from humhub/bs5
Enh: Migration to Bootstrap 5 for HumHub 1.18
2 parents bf59412 + 8eba31e commit 665580d

File tree

15 files changed

+54
-69
lines changed

15 files changed

+54
-69
lines changed

.github/workflows/php-test-master.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/php-test-next.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/auth/ImpersonateAuth.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88

99
namespace humhub\modules\rest\components\auth;
1010

11+
use humhub\modules\rest\models\ImpersonateAuthToken;
1112
use Yii;
1213
use yii\db\Expression;
1314
use yii\filters\auth\HttpBearerAuth;
1415
use yii\helpers\StringHelper;
15-
use humhub\modules\rest\models\ImpersonateAuthToken;
16-
use humhub\modules\user\models\User;
17-
use Firebase\JWT\JWT;
1816

1917
class ImpersonateAuth extends HttpBearerAuth
2018
{

definitions/FileDefinitions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @license https://www.humhub.com/licences
77
*/
88

9-
/* @var $this \humhub\modules\ui\view\components\View */
9+
/* @var $this \humhub\components\View */
1010

1111
namespace humhub\modules\rest\definitions;
1212

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
0.11.0 (July 26, 2025)
5+
----------------------
6+
- Enh #210: Migration to Bootstrap 5 for HumHub 1.18
7+
48
0.10.11 (September 10, 2025)
59
----------------------------
610
- Fix #209: Invite created via `user/invite` endpoint now sets the language correctly

module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"keywords": [
66
"api", "rest"
77
],
8-
"version": "0.10.11",
8+
"version": "0.11.0",
99
"homepage": "https://github.com/humhub/rest",
1010
"humhub": {
11-
"minVersion": "1.16"
11+
"minVersion": "1.18"
1212
},
1313
"screenshots": []
1414
}

tests/codeception.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ coverage:
2121
- ../widgets/*
2222
paths:
2323
tests: codeception
24-
log: codeception/_output
24+
output: codeception/_output
2525
data: codeception/_data
2626
helpers: codeception/_support
2727
envs: ../../../humhub/tests/config/env
2828
config:
2929
# the entry script URL (with host info) for functional and acceptance tests
3030
# PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
3131
test_entry_url: http://localhost:8080/index-test.php
32-

tests/codeception/acceptance.suite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
1010

11-
class_name: AcceptanceTester
11+
actor: AcceptanceTester
1212
modules:
1313
enabled:
1414
- WebDriver
@@ -23,4 +23,4 @@ modules:
2323
port: 4444
2424
capabilities:
2525
chromeOptions:
26-
args: [ "--lang=en-US" ]
26+
args: [ "--lang=en-US" ]

tests/codeception/api.suite.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
55

66
actor: ApiTester
7-
class_name: ApiTester
87
modules:
98
enabled:
109
- REST
@@ -16,4 +15,4 @@ modules:
1615
depends: Yii2
1716
part: Json
1817
Yii2:
19-
configFile: 'codeception/config/api.php'
18+
configFile: 'codeception/config/api.php'

tests/codeception/api/AuthCest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,19 @@ public function testCurrent(ApiTester $I)
9191
public function testImpersonateByAdmin(ApiTester $I)
9292
{
9393
$I->wantTo('Check Impersonate by Admin');
94-
$I->amAdmin();
94+
// Login as Admin by token
95+
// NOTE: Don't use $I->amAdmin() here because it doesn't allow to use Authorization by Impersonate below
96+
$I->sendPOST('auth/login', ['username' => 'Admin', 'password' => 'admin&humhub@PASS%worD!']);
97+
$I->canSeeResponseCodeIs(200);
98+
[$adminToken] = $I->grabDataFromResponseByJsonPath('auth_token');
99+
$I->amBearerAuthenticated($adminToken);
100+
$I->sendGet('auth/current');
101+
$I->seeUserDefinition('Admin');
102+
103+
// Login as impersonated user 2
95104
$I->sendPost('auth/impersonate', ['userId' => 2]);
96105
$I->canSeeResponseCodeIs(200);
97106
[$auth_token] = $I->grabDataFromResponseByJsonPath('token');
98-
$I->amUser(null);
99107
$I->haveHttpHeader('Authorization', "Impersonate $auth_token");
100108
$I->sendGet('auth/current');
101109
$I->seeUserDefinition('User1');

0 commit comments

Comments
 (0)