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

Add GitHub Actions #24

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Unit test
yurabakhtin committed Apr 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f39b6a1a2af55293aa6a6688374160ec7f974071
43 changes: 43 additions & 0 deletions tests/codeception/unit/TextEditorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/

namespace text_editor;

use humhub\modules\file\models\File;
use humhub\modules\text_editor\models\CreateFile;
use humhub\modules\text_editor\models\forms\ConfigForm;
use humhub\modules\text_editor\Module;
use Yii;

class TextEditorTest extends UnitTester
{
public function testTextEditor()
{
/* @var Module $module */
$module = Yii::$app->getModule('text-editor');

$this->assertFalse($module->canCreate());

$config = new ConfigForm();
$config->allowNewFiles = true;
$config->save();

$this->assertTrue($module->canCreate());

$createFile = new CreateFile();
$createFile->fileName = 'test.any';
$testFile = $createFile->save();

$this->assertTrue($module->canView($testFile));
$this->assertTrue($module->canEdit($testFile));

$testFile->mime_type = 'image/jpeg';

$this->assertFalse($module->canView($testFile));
$this->assertFalse($module->canEdit($testFile));
}
}
15 changes: 0 additions & 15 deletions tests/codeception/unit/WhitelabelTest.php

This file was deleted.