The clean & modern RSS server that doesn't give you any crap.
https://thearsse.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.9 KiB
70 lines
1.9 KiB
7 years ago
|
<?php
|
||
7 years ago
|
/** @license MIT
|
||
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
||
|
* See LICENSE and AUTHORS files for details */
|
||
|
|
||
7 years ago
|
declare(strict_types=1);
|
||
7 years ago
|
namespace JKingWeb\Arsse;
|
||
7 years ago
|
|
||
7 years ago
|
use org\bovigo\vfs\vfsStream;
|
||
7 years ago
|
|
||
7 years ago
|
/** @covers \JKingWeb\Arsse\Lang */
|
||
7 years ago
|
class TestLangErrors extends Test\AbstractTest {
|
||
|
use Test\Lang\Setup;
|
||
7 years ago
|
|
||
7 years ago
|
public $files;
|
||
|
public $path;
|
||
|
public $l;
|
||
7 years ago
|
|
||
7 years ago
|
public function setUpSeries() {
|
||
7 years ago
|
$this->l->set("", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadEmptyFile() {
|
||
7 years ago
|
$this->assertException("fileCorrupt", "Lang");
|
||
7 years ago
|
$this->l->set("fr_ca", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadFileWhichDoesNotReturnAnArray() {
|
||
7 years ago
|
$this->assertException("fileCorrupt", "Lang");
|
||
7 years ago
|
$this->l->set("it", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadFileWhichIsNotPhp() {
|
||
7 years ago
|
$this->assertException("fileCorrupt", "Lang");
|
||
7 years ago
|
$this->l->set("ko", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadFileWhichIsCorrupt() {
|
||
7 years ago
|
$this->assertException("fileCorrupt", "Lang");
|
||
7 years ago
|
$this->l->set("zh", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadFileWithooutReadPermission() {
|
||
7 years ago
|
$this->assertException("fileUnreadable", "Lang");
|
||
7 years ago
|
$this->l->set("ru", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadSubtagOfMissingLanguage() {
|
||
7 years ago
|
$this->assertException("fileMissing", "Lang");
|
||
7 years ago
|
$this->l->set("pt_br", true);
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testFetchInvalidMessage() {
|
||
7 years ago
|
$this->assertException("stringInvalid", "Lang");
|
||
7 years ago
|
$this->l->set("vi", true);
|
||
|
$txt = $this->l->msg('Test.presentText');
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testFetchMissingMessage() {
|
||
7 years ago
|
$this->assertException("stringMissing", "Lang");
|
||
7 years ago
|
$txt = $this->l->msg('Test.absentText');
|
||
7 years ago
|
}
|
||
|
|
||
7 years ago
|
public function testLoadMissingDefaultLanguage() {
|
||
7 years ago
|
unlink($this->path.Lang::DEFAULT.".php");
|
||
7 years ago
|
$this->assertException("defaultFileMissing", "Lang");
|
||
7 years ago
|
$this->l->set("fr", true);
|
||
7 years ago
|
}
|
||
7 years ago
|
}
|