diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..404af35 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea +vendor/ +composer.lock + diff --git a/composer.json b/composer.json index 2d772b4..4c458bf 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "phpbb-extension", "description": "This is an extension for PHPBB 3.1 that allows to highlight the code", "homepage": "https://github.com/oxcom/phpbbch", - "version": "1.1.0", + "version": "1.0.1", "keywords": ["phpbb", "extension", "highlight"], "license": "MIT", "authors": [ @@ -18,8 +18,13 @@ "php": ">=5.6", "composer/installers": "~1.4.0" }, + "autoload-dev": { + "psr-4": { + "oxcom\\phpbbch\\": "" + } + }, "require-dev": { - "phpbb/epv": "0.0.*" + "phpunit/phpunit": "^9.5.8" }, "extra": { "display-name": "PHPBB Code Highlight", diff --git a/tests/FileMapTest.php b/tests/FileMapTest.php index 68de0ff..b685325 100644 --- a/tests/FileMapTest.php +++ b/tests/FileMapTest.php @@ -2,13 +2,31 @@ namespace oxcom\phpbbch\tests; -class FileMapTest +use oxcom\phpbbch\core\settings; +use PHPUnit\Framework\TestCase; + +class FileMapTest extends TestCase { + const LANG_JS_PATH = './../styles/all/template/js/higlightjs/languages'; + const LANG_THEME_PATH = './../styles/all/theme/higlightjs'; + public function testTheme() { + foreach (settings::getLanguages() as $file => $name) { + $path = __DIR__.'/'.self::LANG_JS_PATH.'/'.$file.'.min.js'; + $path = \realpath($path); + + self::assertTrue(\file_exists($path), "File not found for language $name"); + } } public function testLanguage() { + foreach (settings::getThemes() as $file => $name) { + $path = __DIR__.'/'.self::LANG_THEME_PATH.'/'.$file.'.min.css'; + $path = \realpath($path); + + self::assertTrue(\file_exists($path), "File not found for theme $name"); + } } }