Implemented Loader class and added reference repository (for now as git repo, in future - as composer package)

This commit is contained in:
ErickSkrauch
2016-04-28 01:01:04 +03:00
parent ed82b4a986
commit afad6a5b09
3 changed files with 102 additions and 1 deletions

47
tests/Loadertest.php Normal file
View 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',
];
}
}