php-tempmailbuster/tests/StorageTest.php
ErickSkrauch ca7e357b68 Refactored Storage to be just Storage (not blacklist)
Implemented whitelist functionality
2016-04-28 23:39:20 +03:00

30 lines
877 B
PHP

<?php
namespace Ely\TempMailBuster;
class StorageTest extends \PHPUnit_Framework_TestCase
{
public function testGetItems()
{
$storage = new Storage(['item']);
$this->assertEquals(['item'], $storage->getItems());
}
public function testAppend()
{
$storage = new Storage(['item1']);
$this->assertEquals($storage, $storage->append(['item2']));
$this->assertEquals(['item1', 'item2'], $storage->getItems());
$storage = new Storage(['item1']);
$this->assertEquals($storage, $storage->append('item2'));
$this->assertEquals(['item1', 'item2'], $storage->getItems());
}
public function testSetItems()
{
$storage = new Storage(['item1']);
$this->assertEquals($storage, $storage->setItems(['item2']));
$this->assertEquals(['item2'], $storage->getItems());
}
}