for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace PhpValueObjects\Tests\Collection;
use PhpValueObjects\Collection\Exception\InvalidCollectionObjectException;
class CollectionTest extends \PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function itShouldThrowInvalidCollectionObjectException()
$this->expectException(InvalidCollectionObjectException::class);
new Collection([new \stdClass(), new \stdClass()]);
}
public function itShouldReturnCollection()
$objects = [
new ObjectForTest(),
new ObjectForTest()
];
$collection = new Collection($objects);
$this->assertSame($objects, $collection->getCollection());
public function itShouldReturnEmptyCollection()
$collection = new Collection([]);
$this->assertEmpty($collection->getCollection());