Skip to content

Commit

Permalink
Merge pull request #118 from humhub/fix/114-tests
Browse files Browse the repository at this point in the history
Fix tests on soft delete of content
  • Loading branch information
luke- authored Apr 27, 2023
2 parents b399c5c + 1f3fc80 commit cc379ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion controllers/content/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public function actionView($id)

public function actionDelete($id)
{
$content = Content::findOne(['id' => $id]);
$content = Content::find()
->where(['id' => $id])
->andWhere(['!=', 'state', Content::STATE_DELETED])
->one();

if ($content === null) {
return $this->returnError(404, 'Content not found!');
}
Expand Down
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Changelog
- Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating
- Enh #112: Added support of HttpBearer and QueryParam auth methods
- Enh #117: Added support of user Impersonate
- Enh #113: Deleted unnecessary code used for Calendar And Task Modules
- Enh #113: Deleted unnecessary code used for Calendar And Task Modules
- Fix #114: Fix tests on soft delete of content

0.8.0 (March 10, 2023)
----------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/codeception/acceptance/BearerTokensManagementCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class BearerTokensManagementCest
{

public function addNewBearerToken(AcceptanceTester $I)
{
$expiration = (new \Datetime('tomorrow'));
Expand All @@ -24,7 +24,7 @@ public function addNewBearerToken(AcceptanceTester $I)
$I->selectUserFromPicker('#restuserbearertoken-userguid', 'Peter Tester');
$I->fillField('RestUserBearerToken[expiration]', Yii::$app->formatter->asDate($expiration, 'short'));
$I->fillField('RestUserBearerToken[expirationTime]', Yii::$app->formatter->asTime($expiration, 'short'));
$I->click('Add');
$I->jsClick('form button[type=submit]');
$I->waitForText(Yii::$app->formatter->asDate($expiration));
}

Expand Down

0 comments on commit cc379ce

Please sign in to comment.