Static Loader class was refactored into AntiTempmailRepo class.

Added LoaderInterface.
Added fromLoader creator for Storage.
This commit is contained in:
ErickSkrauch
2016-04-29 01:53:51 +03:00
parent b2b8a0438f
commit 7b82e48cdd
7 changed files with 150 additions and 85 deletions

View File

@@ -26,4 +26,17 @@ class StorageTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($storage, $storage->appendItems('item2'));
$this->assertEquals(['item1', 'item2'], $storage->getItems());
}
public function testFromLoader()
{
$this->assertInstanceOf('Ely\TempmailBuster\Storage', Storage::fromLoader(new SimpleLoader()));
}
}
class SimpleLoader implements LoaderInterface
{
public function load()
{
return ['foo', 'bar'];
}
}