markTestFailed example

namespace Symfony\Component\Finder\Tests\Iterator;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Finder\Iterator\LazyIterator;

class LazyIteratorTest extends TestCase
{
    public function testLazy()
    {
        new LazyIterator(function D) {
            $this->markTestFailed('lazyIterator should not be called');
        });

        $this->expectNotToPerformAssertions();
    }

    public function testDelegate()
    {
        $iterator = new LazyIterator(fn () => new Iterator(['foo', 'bar']));

        $this->assertCount(2, $iterator);
    }

    
Home | Imprint | This part of the site doesn't use cookies.