mirror of
https://github.com/humhub/humhub.git
synced 2025-04-21 15:41:54 +02:00
Debug github action test fails
This commit is contained in:
parent
3f1e2a06b6
commit
4f65ce85d8
2
.github/workflows/php-test.yml
vendored
2
.github/workflows/php-test.yml
vendored
@ -116,4 +116,4 @@ jobs:
|
||||
run: sleep 5 && curl --fail --head http://127.0.0.1:8080/index-test.php
|
||||
|
||||
- name: Run test suite
|
||||
run: grunt test -build -env=github
|
||||
run: grunt test -build -module=content -env=github
|
||||
|
@ -852,8 +852,8 @@ class RichTextHtmlConverterTest extends HumHubDbTestCase
|
||||
|
||||
// Currently relative image
|
||||
static::assertEquals(
|
||||
trim(preg_replace('/\s+/', ' ', $expected)),
|
||||
trim(preg_replace('/\s+/', ' ', $result)));
|
||||
trim(preg_replace('/\s+/', '', $expected)),
|
||||
trim(preg_replace('/\s+/', '', $result)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,15 +23,6 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
{
|
||||
parent::_before();
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
}
|
||||
|
||||
public function testScanSingleOembed()
|
||||
@ -43,6 +34,16 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
|
||||
public function testLoadOembed()
|
||||
{
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
|
||||
$result = OembedExtension::scanLinkExtension('[https://www.youtube.com/watch?v=yt1](oembed:https://www.youtube.com/watch?v=yt1)');
|
||||
$oembed = UrlOembed::getOEmbed($result[0]->getExtensionId());
|
||||
static::assertNotNull($oembed);
|
||||
@ -54,6 +55,16 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
*/
|
||||
public function testParseSingleOembed()
|
||||
{
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
|
||||
$text = "[https://www.youtube.com/watch?v=yt1](oembed:https://www.youtube.com/watch?v=yt1)";
|
||||
$oembeds = OembedExtension::parseOembeds($text);
|
||||
static::assertCount(1, $oembeds);
|
||||
@ -65,6 +76,16 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
*/
|
||||
public function testParseMultipleOembeds()
|
||||
{
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
|
||||
$text = "[https://www.youtube.com/watch?v=yt1](oembed:https://www.youtube.com/watch?v=yt1)\n\n[https://www.youtube.com/watch?v=yt2](oembed:https://www.youtube.com/watch?v=yt2)";
|
||||
$oembeds = OembedExtension::parseOembeds($text);
|
||||
static::assertCount(2, $oembeds);
|
||||
@ -77,6 +98,16 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
*/
|
||||
public function testParseOembedsWithMax()
|
||||
{
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
|
||||
$text = "[https://www.youtube.com/watch?v=yt1](oembed:https://www.youtube.com/watch?v=yt1)\n\n[https://www.youtube.com/watch?v=yt2](oembed:https://www.youtube.com/watch?v=yt2)";
|
||||
$oembeds = OembedExtension::parseOembeds($text, 1);
|
||||
static::assertCount(1, $oembeds);
|
||||
@ -88,6 +119,16 @@ class RichTextOembedTest extends HumHubDbTestCase
|
||||
*/
|
||||
public function testParseOembedsWithZeroMax()
|
||||
{
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt1',
|
||||
'preview' => 'yt1'
|
||||
]))->save());
|
||||
|
||||
static::assertTrue((new UrlOembed([
|
||||
'url' => 'https://www.youtube.com/watch?v=yt2',
|
||||
'preview' => 'yt2'
|
||||
]))->save());
|
||||
|
||||
$text = "[https://www.youtube.com/watch?v=yt1](oembed:https://www.youtube.com/watch?v=yt1)\n\n[https://www.youtube.com/watch?v=yt2](oembed:https://www.youtube.com/watch?v=yt2)";
|
||||
$oembeds = OembedExtension::parseOembeds($text, 0);
|
||||
static::assertCount(0, $oembeds);
|
||||
|
@ -27,11 +27,16 @@ class Events extends BaseObject
|
||||
|
||||
public static function onHourlyCron($event)
|
||||
{
|
||||
/** @var Controller $controller */
|
||||
$controller = $event->sender;
|
||||
try {
|
||||
/** @var Controller $controller */
|
||||
$controller = $event->sender;
|
||||
|
||||
$controller->stdout('Optimizing search index...');
|
||||
Yii::$app->search->optimize();
|
||||
$controller->stdout('done.' . PHP_EOL, Console::FG_GREEN);
|
||||
$controller->stdout("Optimizing search index...\n");
|
||||
Yii::$app->search->optimize();
|
||||
$controller->stdout('done.' . PHP_EOL, Console::FG_GREEN);
|
||||
} catch (\Throwable $e) {
|
||||
$controller->stderr($e->getMessage()."\n'");
|
||||
Yii::error($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user