mirror of
https://github.com/doctrine/collections.git
synced 2026-03-24 06:32:10 +01:00
It makes it more obvious to humans or tools what is overriding/implementing something and what is not.
36 lines
940 B
PHP
36 lines
940 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Doctrine\Tests\Common\Collections;
|
|
|
|
use Doctrine\Common\Collections\AbstractLazyCollection;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Override;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
|
|
use function assert;
|
|
|
|
/**
|
|
* Tests for {@see AbstractLazyCollection}.
|
|
*/
|
|
#[CoversClass(AbstractLazyCollection::class)]
|
|
class AbstractLazyArrayCollectionTest extends ArrayCollectionTestCase
|
|
{
|
|
#[Override]
|
|
protected function buildCollection(array $elements = []): Collection
|
|
{
|
|
return new LazyArrayCollection(new ArrayCollection($elements));
|
|
}
|
|
|
|
public function testLazyCollection(): void
|
|
{
|
|
$collection = $this->buildCollection(['a', 'b', 'c']);
|
|
assert($collection instanceof LazyArrayCollection);
|
|
|
|
self::assertFalse($collection->isInitialized());
|
|
self::assertCount(3, $collection);
|
|
}
|
|
}
|