getViolationsCount example

$this->createMock(ConstraintViolation::class),
        ]);
        $originalValidator->method('validate')->willReturn($violations);

        $validator->validate(new \stdClass());

        $collector->lateCollect();

        $calls = $collector->getCalls();

        $this->assertCount(1, $calls);
        $this->assertSame(2, $collector->getViolationsCount());

        $call = $calls[0];

        $this->assertArrayHasKey('caller', $call);
        $this->assertArrayHasKey('context', $call);
        $this->assertArrayHasKey('violations', $call);
        $this->assertCount(2, $call['violations']);
    }

    public function testReset()
    {
        
Home | Imprint | This part of the site doesn't use cookies.