for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace xKerman\Restricted\Test;
use PHPUnit\Framework\TestCase;
use xKerman\Restricted\Source;
/**
* @coversDefaultClass \xKerman\Restricted\Source
*/
class SourceTest extends TestCase
{
* @expectedException \InvalidArgumentException
public function testConstructFailed()
new Source(2);
}
public function testPeek()
$source = new Source('hello');
$this->assertSame('h', $source->peek());
* @covers ::next
public function testNext()
$source->next();
$this->assertSame('e', $source->peek());
* @covers ::consume
public function testConsumeSucceeded()
$source->consume('h');
* @expectedException \xKerman\Restricted\UnserializeFailedException
public function testConsumeFailure()
$source->consume('e');