objectManager->get(SettingsValidator::class); $result = $validator->validate(new TestObject()); $this->assertTrue($result->hasErrors()); $this->assertCount(1, $result->getFlattenedErrors()); $this->assertCount(1, $result->forProperty('shouldBeFalse')->getErrors()); } /** * @test */ public function conjunctionValidationWorksAsExpected() { $validatorResolver = $this->objectManager->get(ValidatorResolver::class); $validator = $validatorResolver->getBaseValidatorConjunction(TestObject::class); $result = $validator->validate(new TestObject()); $this->assertTrue($result->hasErrors()); $this->assertCount(1, $result->getFlattenedErrors()); } }