mirror of
https://github.com/elyby/php-tempmailbuster.git
synced 2024-11-08 13:42:37 +05:30
Return file in valid case
This commit is contained in:
parent
3a46c20544
commit
e78a2ccd84
47
tests/LoaderTest.php
Normal file
47
tests/LoaderTest.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
namespace Ely\TempMailBuster;
|
||||
|
||||
class LoaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testGetPaths()
|
||||
{
|
||||
$this->assertTrue(is_array(Loader::getPaths()));
|
||||
}
|
||||
|
||||
public function testLoad()
|
||||
{
|
||||
$this->assertTrue(is_array(Loader::load()));
|
||||
}
|
||||
|
||||
public function testLoadExceptionWrongPaths()
|
||||
{
|
||||
$this->expectException('Exception');
|
||||
LoaderWithWrongPaths::load();
|
||||
}
|
||||
|
||||
public function testLoadExceptionInvalidJson()
|
||||
{
|
||||
$this->expectException('Exception');
|
||||
LoaderWithInvalidJson::load();
|
||||
}
|
||||
}
|
||||
|
||||
class LoaderWithWrongPaths extends Loader
|
||||
{
|
||||
public static function getPaths()
|
||||
{
|
||||
return [
|
||||
__DIR__ . '/virtual_reality.json',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class LoaderWithInvalidJson extends Loader
|
||||
{
|
||||
public static function getPaths()
|
||||
{
|
||||
return [
|
||||
__DIR__ . '/LoaderTest.php',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user