mirror of
https://github.com/humhub/humhub.git
synced 2025-02-11 19:16:04 +01:00
Fix: Added missing Emoji mappings used for plain richtext output
This commit is contained in:
parent
e904693aaf
commit
8e7009e79c
File diff suppressed because it is too large
Load Diff
31
protected/humhub/modules/ui/tests/codeception.yml
Normal file
31
protected/humhub/modules/ui/tests/codeception.yml
Normal file
@ -0,0 +1,31 @@
|
||||
actor: Tester
|
||||
namespace: ui
|
||||
bootstrap: _bootstrap.php
|
||||
coverage:
|
||||
c3_url: 'http://localhost:8080/index-test.php'
|
||||
enabled: true
|
||||
remote: false
|
||||
include:
|
||||
- ../models/*
|
||||
- ../widgets/*
|
||||
- ../Module.php
|
||||
settings:
|
||||
suite_class: \PHPUnit_Framework_TestSuite
|
||||
colors: true
|
||||
shuffle: false
|
||||
memory_limit: 1024M
|
||||
log: true
|
||||
|
||||
# This value controls whether PHPUnit attempts to backup global variables
|
||||
# See https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobals
|
||||
backup_globals: true
|
||||
paths:
|
||||
tests: codeception
|
||||
log: codeception/_output
|
||||
data: codeception/_data
|
||||
helpers: codeception/_support
|
||||
envs: ../../../tests/config/env
|
||||
config:
|
||||
# the entry script URL (with host info) for functional and acceptance tests
|
||||
# PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
|
||||
test_entry_url: http://localhost:8080/index-test.php
|
49
protected/humhub/modules/ui/tests/codeception/_bootstrap.php
Normal file
49
protected/humhub/modules/ui/tests/codeception/_bootstrap.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* This is the initial test bootstrap, which will load the default test bootstrap from the humhub core
|
||||
*/
|
||||
// Parse the environment arguments (Note: only simple --env ENV is supported no comma sepration merge...)
|
||||
$env = isset($GLOBALS['env']) ? $GLOBALS['env'] : [];
|
||||
|
||||
// If environment was set try loading special environment config else load default
|
||||
if (count($env) > 0) {
|
||||
\Codeception\Configuration::append(['environment' => $env]);
|
||||
|
||||
|
||||
$envCfgFile = dirname(__DIR__) . '/config/env/test.' . $env[0][0] . '.php';
|
||||
|
||||
if (file_exists($envCfgFile)) {
|
||||
$cfg = array_merge(require_once(__DIR__ . '/../config/test.php'), require_once($envCfgFile));
|
||||
}
|
||||
}
|
||||
|
||||
// If no environment is set we have to load the default config
|
||||
if (!isset($cfg)) {
|
||||
$cfg = require_once(__DIR__ . '/../config/test.php');
|
||||
}
|
||||
|
||||
// If no humhub_root is given we assume our module is in the a root to be in /protected/humhub/modules/<module>/tests/codeception directory
|
||||
$cfg['humhub_root'] = isset($cfg['humhub_root']) ? $cfg['humhub_root'] : dirname(__DIR__) . '/../../../../..';
|
||||
|
||||
|
||||
// Load default test bootstrap
|
||||
require_once($cfg['humhub_root'] . '/protected/humhub/tests/codeception/_bootstrap.php');
|
||||
|
||||
// Overwrite the default test alias
|
||||
Yii::setAlias('@tests', dirname(__DIR__));
|
||||
Yii::setAlias('@env', '@tests/config/env');
|
||||
Yii::setAlias('@root', $cfg['humhub_root']);
|
||||
Yii::setAlias('@humhubTests', $cfg['humhub_root'] . '/protected/humhub/tests');
|
||||
|
||||
// Load all supporting test classes needed for test execution
|
||||
\Codeception\Util\Autoload::addNamespace('', Yii::getAlias('@humhubTests/codeception/_support'));
|
||||
\Codeception\Util\Autoload::addNamespace('tests\codeception\fixtures', Yii::getAlias('@humhubTests/codeception/fixtures'));
|
||||
\Codeception\Util\Autoload::addNamespace('', Yii::getAlias('@humhubTests/codeception/_pages'));
|
||||
if(isset($cfg['modules'])) {
|
||||
\Codeception\Configuration::append(['humhub_modules' => $cfg['modules']]);
|
||||
}
|
||||
|
||||
if(isset($cfg['fixtures'])) {
|
||||
\Codeception\Configuration::append(['fixtures' => $cfg['fixtures']]);
|
||||
}
|
||||
?>
|
4
protected/humhub/modules/ui/tests/codeception/_output/.gitignore
vendored
Normal file
4
protected/humhub/modules/ui/tests/codeception/_output/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace ui;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class AcceptanceTester extends \AcceptanceTester
|
||||
{
|
||||
use _generated\AcceptanceTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace ui;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class FunctionalTester extends \FunctionalTester
|
||||
{
|
||||
use _generated\FunctionalTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace ui;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class UnitTester extends \UnitTester
|
||||
{
|
||||
use _generated\UnitTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
# Codeception Test Suite Configuration
|
||||
|
||||
# suite for acceptance tests.
|
||||
# perform tests in browser using the Selenium-like tools.
|
||||
# powered by Mink (http://mink.behat.org).
|
||||
# (tip: that's what your customer will see).
|
||||
# (tip: test your ajax and javascript by one of Mink drivers).
|
||||
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
|
||||
class_name: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- WebDriver
|
||||
- tests\codeception\_support\WebHelper
|
||||
- tests\codeception\_support\DynamicFixtureHelper
|
||||
config:
|
||||
WebDriver:
|
||||
url: 'http://localhost:8080/'
|
||||
browser: chrome
|
||||
window_size: maximize
|
||||
port: 4444
|
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
|
||||
* in @tests/config/functional.php
|
||||
*/
|
||||
require(Yii::getAlias('@humhubTests/codeception/acceptance/_bootstrap.php'));
|
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('functional');
|
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('unit');
|
@ -0,0 +1,18 @@
|
||||
# Codeception Test Suite Configuration
|
||||
|
||||
# suite for functional (integration) tests.
|
||||
# emulate web requests and make application process them.
|
||||
# (tip: better to use with frameworks).
|
||||
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
class_name: FunctionalTester
|
||||
modules:
|
||||
enabled:
|
||||
- Filesystem
|
||||
- Yii2
|
||||
- tests\codeception\_support\TestHelper
|
||||
- tests\codeception\_support\DynamicFixtureHelper
|
||||
- tests\codeception\_support\HumHubHelper
|
||||
config:
|
||||
Yii2:
|
||||
configFile: 'codeception/config/functional.php'
|
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
|
||||
* in @tests/config/functional.php
|
||||
*/
|
||||
require(Yii::getAlias('@humhubTests/codeception/functional/_bootstrap.php'));
|
14
protected/humhub/modules/ui/tests/codeception/unit.suite.yml
Normal file
14
protected/humhub/modules/ui/tests/codeception/unit.suite.yml
Normal file
@ -0,0 +1,14 @@
|
||||
# Codeception Test Suite Configuration
|
||||
|
||||
# suite for unit (internal) tests.
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
|
||||
class_name: UnitTester
|
||||
modules:
|
||||
enabled:
|
||||
- tests\codeception\_support\CodeHelper
|
||||
- Yii2
|
||||
config:
|
||||
Yii2:
|
||||
configFile: 'codeception/config/unit.php'
|
||||
transaction: false
|
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten
|
||||
* in @tests/config/functional.php
|
||||
*/
|
||||
require(Yii::getAlias('@humhubTests/codeception/unit/_bootstrap.php'));
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace tests\codeception\unit;
|
||||
|
||||
use humhub\libs\EmojiMap;
|
||||
use tests\codeception\_support\HumHubDbTestCase;
|
||||
|
||||
class EmojiTest extends HumHubDbTestCase
|
||||
{
|
||||
/**
|
||||
* Make sure users with create topic permission sees topic picker
|
||||
*/
|
||||
public function testEmojiMapCoversAllRichtextEmojis()
|
||||
{
|
||||
$emoji = json_decode(file_get_contents(__dir__ . '\emoji.json'), true);
|
||||
foreach ($emoji as $key => $def) {
|
||||
$this->assertArrayHasKey($key, EmojiMap::MAP);
|
||||
}
|
||||
}
|
||||
}
|
9422
protected/humhub/modules/ui/tests/codeception/unit/emoji/emoji.json
Normal file
9422
protected/humhub/modules/ui/tests/codeception/unit/emoji/emoji.json
Normal file
File diff suppressed because it is too large
Load Diff
5
protected/humhub/modules/ui/tests/config/common.php
Normal file
5
protected/humhub/modules/ui/tests/config/common.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* This config is shared by all suites (unit/functional/acceptance) and can be overwritten by a suite config (e.g. functional.php)
|
||||
*/
|
||||
return [];
|
5
protected/humhub/modules/ui/tests/config/functional.php
Normal file
5
protected/humhub/modules/ui/tests/config/functional.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Here you can overwrite the default config for the functional suite. The default config resides in @humhubTests/codeception/config/config.php
|
||||
*/
|
||||
return [];
|
5
protected/humhub/modules/ui/tests/config/test.php
Normal file
5
protected/humhub/modules/ui/tests/config/test.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'fixtures' => ['default']
|
||||
];
|
5
protected/humhub/modules/ui/tests/config/unit.php
Normal file
5
protected/humhub/modules/ui/tests/config/unit.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Here you can overwrite your functional humhub config. The default config resiedes in @humhubTests/codeception/config/config.php
|
||||
*/
|
||||
return [];
|
Loading…
x
Reference in New Issue
Block a user