mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 08:34:56 +00:00
574388665a
- Skeleton of mock internal driver - Skeleton of test suite - Re-arranged lots of code - Made drive name localized (improves #37)
70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace JKingWeb\NewsSync;
|
|
|
|
|
|
class TestException extends \PHPUnit\Framework\TestCase {
|
|
use Test\Tools;
|
|
|
|
static function setUpBeforeClass() {
|
|
Lang::set("");
|
|
}
|
|
|
|
static function tearDownAfterClass() {
|
|
Lang::set(Lang::DEFAULT);
|
|
}
|
|
|
|
function testBaseClass() {
|
|
$this->assertException("unknown");
|
|
throw new Exception("unknown");
|
|
}
|
|
|
|
/**
|
|
* @depends testBaseClass
|
|
*/
|
|
function testBaseClassWithoutMessage() {
|
|
$this->assertException("unknown");
|
|
throw new Exception();
|
|
}
|
|
|
|
/**
|
|
* @depends testBaseClass
|
|
*/
|
|
function testDerivedClass() {
|
|
$this->assertException("fileMissing", "Lang");
|
|
throw new Lang\Exception("fileMissing");
|
|
}
|
|
|
|
/**
|
|
* @depends testDerivedClass
|
|
*/
|
|
function testDerivedClassWithMessageParameters() {
|
|
$this->assertException("fileMissing", "Lang");
|
|
throw new Lang\Exception("fileMissing", "en");
|
|
}
|
|
|
|
/**
|
|
* @depends testBaseClass
|
|
*/
|
|
function testBaseClassWithUnknownCode() {
|
|
$this->assertException("uncoded");
|
|
throw new Exception("testThisExceptionMessageDoesNotExist");
|
|
}
|
|
|
|
/**
|
|
* @depends testBaseClass
|
|
*/
|
|
function testBaseClassWithMissingMessage() {
|
|
$this->assertException("stringMissing", "Lang");
|
|
throw new Exception("invalid");
|
|
}
|
|
|
|
/**
|
|
* @depends testBaseClassWithUnknownCode
|
|
*/
|
|
function testDerivedClassWithMissingMessage() {
|
|
$this->assertException("uncoded");
|
|
throw new Lang\Exception("testThisExceptionMessageDoesNotExist");
|
|
}
|
|
|
|
}
|