php-tempmailbuster/tests/StorageTest.php

30 lines
892 B
PHP
Raw Normal View History

<?php
namespace Ely\TempMailBuster;
class StorageTest extends \PHPUnit_Framework_TestCase
{
public function testGetItems()
{
$storage = new Storage(['item']);
$this->assertEquals(['item'], $storage->getItems());
}
2016-04-29 02:44:34 +05:30
public function testSetItems()
{
$storage = new Storage(['item1']);
2016-04-29 02:44:34 +05:30
$this->assertEquals($storage, $storage->setItems(['item2']));
$this->assertEquals(['item2'], $storage->getItems());
}
2016-04-29 02:44:34 +05:30
public function testAppendItems()
{
$storage = new Storage(['item1']);
2016-04-29 02:44:34 +05:30
$this->assertEquals($storage, $storage->appendItems(['item2']));
$this->assertEquals(['item1', 'item2'], $storage->getItems());
$storage = new Storage(['item1']);
2016-04-29 02:44:34 +05:30
$this->assertEquals($storage, $storage->appendItems('item2'));
$this->assertEquals(['item1', 'item2'], $storage->getItems());
}
}