2016-04-27 01:59:38 +05:30
|
|
|
<?php
|
|
|
|
namespace Ely\TempMailBuster;
|
|
|
|
|
|
|
|
class StorageTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
2016-04-29 02:07:24 +05:30
|
|
|
public function testGetItems()
|
2016-04-27 01:59:38 +05:30
|
|
|
{
|
|
|
|
$storage = new Storage(['item']);
|
2016-04-29 02:07:24 +05:30
|
|
|
$this->assertEquals(['item'], $storage->getItems());
|
2016-04-27 01:59:38 +05:30
|
|
|
}
|
|
|
|
|
2016-04-29 02:07:24 +05:30
|
|
|
public function testAppend()
|
2016-04-27 01:59:38 +05:30
|
|
|
{
|
|
|
|
$storage = new Storage(['item1']);
|
2016-04-29 02:07:24 +05:30
|
|
|
$this->assertEquals($storage, $storage->append(['item2']));
|
|
|
|
$this->assertEquals(['item1', 'item2'], $storage->getItems());
|
2016-04-27 01:59:38 +05:30
|
|
|
|
|
|
|
$storage = new Storage(['item1']);
|
2016-04-29 02:07:24 +05:30
|
|
|
$this->assertEquals($storage, $storage->append('item2'));
|
|
|
|
$this->assertEquals(['item1', 'item2'], $storage->getItems());
|
2016-04-27 01:59:38 +05:30
|
|
|
}
|
|
|
|
|
2016-04-29 02:07:24 +05:30
|
|
|
public function testSetItems()
|
2016-04-27 01:59:38 +05:30
|
|
|
{
|
|
|
|
$storage = new Storage(['item1']);
|
2016-04-29 02:07:24 +05:30
|
|
|
$this->assertEquals($storage, $storage->setItems(['item2']));
|
|
|
|
$this->assertEquals(['item2'], $storage->getItems());
|
2016-04-27 01:59:38 +05:30
|
|
|
}
|
|
|
|
}
|