-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: DokuWiki Default Tasks | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '17 23 14 * *' | ||
|
||
|
||
jobs: | ||
all: | ||
uses: dokuwiki/github-action/.github/workflows/all.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Create release on change to plugin.info.txt version line | ||
# https://github.com/dokuwiki/dokuwiki/issues/3951 | ||
# | ||
# Requires DOKUWIKI_USER and DOKUWIKI_PASS secrets be set in GitHub Actions | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "*.info.txt" | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
# https://github.com/dokuwiki/dokuwiki/pull/3966 | ||
uses: glensc/dokuwiki/.github/workflows/plugin-release.yml@39431875f734bddc35cc6b4a899bbfdec97e8aba | ||
secrets: | ||
DOKUWIKI_USER: ${{ secrets.DOKUWIKI_USER }} | ||
DOKUWIKI_PASS: ${{ secrets.DOKUWIKI_PASS }} | ||
|
||
# vim:ts=2:sw=2:et |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
namespace dokuwiki\plugin\saveandedit\test; | ||
|
||
use DokuWikiTest; | ||
|
||
/** | ||
* General tests for the saveandedit plugin | ||
* | ||
* @group plugin_saveandedit | ||
* @group plugins | ||
*/ | ||
class GeneralTest extends DokuWikiTest | ||
{ | ||
/** | ||
* Simple test to make sure the plugin.info.txt is in correct format | ||
*/ | ||
public function testPluginInfo(): void | ||
{ | ||
$file = __DIR__ . '/../plugin.info.txt'; | ||
$this->assertFileExists($file); | ||
|
||
$info = confToHash($file); | ||
|
||
$this->assertArrayHasKey('base', $info); | ||
$this->assertArrayHasKey('author', $info); | ||
$this->assertArrayHasKey('email', $info); | ||
$this->assertArrayHasKey('date', $info); | ||
$this->assertArrayHasKey('name', $info); | ||
$this->assertArrayHasKey('desc', $info); | ||
$this->assertArrayHasKey('url', $info); | ||
|
||
$this->assertEquals('saveandedit', $info['base']); | ||
$this->assertRegExp('/^https?:\/\//', $info['url']); | ||
$this->assertTrue(mail_isvalid($info['email'])); | ||
$this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']); | ||
$this->assertTrue(false !== strtotime($info['date'])); | ||
} | ||
|
||
/** | ||
* Test to ensure that every conf['...'] entry in conf/default.php has a corresponding meta['...'] entry in | ||
* conf/metadata.php. | ||
*/ | ||
public function testPluginConf(): void | ||
{ | ||
$conf_file = __DIR__ . '/../conf/default.php'; | ||
$meta_file = __DIR__ . '/../conf/metadata.php'; | ||
|
||
if (!file_exists($conf_file) && !file_exists($meta_file)) { | ||
self::markTestSkipped('No config files exist -> skipping test'); | ||
} | ||
|
||
if (file_exists($conf_file)) { | ||
include($conf_file); | ||
} | ||
if (file_exists($meta_file)) { | ||
include($meta_file); | ||
} | ||
|
||
$this->assertEquals( | ||
gettype($conf), | ||
gettype($meta), | ||
'Both ' . DOKU_PLUGIN . 'saveandedit/conf/default.php and ' . DOKU_PLUGIN . 'saveandedit/conf/metadata.php have to exist and contain the same keys.' | ||
); | ||
|
||
if ($conf !== null && $meta !== null) { | ||
foreach ($conf as $key => $value) { | ||
$this->assertArrayHasKey( | ||
$key, | ||
$meta, | ||
'Key $meta[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'saveandedit/conf/metadata.php' | ||
); | ||
} | ||
|
||
foreach ($meta as $key => $value) { | ||
$this->assertArrayHasKey( | ||
$key, | ||
$conf, | ||
'Key $conf[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'saveandedit/conf/default.php' | ||
); | ||
} | ||
} | ||
} | ||
} |