mirror of
https://github.com/elyby/php-tempmailbuster.git
synced 2025-05-31 14:11:41 +05:30
Static Loader class was refactored into AntiTempmailRepo class.
Added LoaderInterface. Added fromLoader creator for Storage.
This commit is contained in:
@@ -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'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user