get(ValidatorInterface::class); $versionParameter = new VersionParameter(); $versionParameter->setValue(123); $errors = $validator->validate($versionParameter)->count(); $this->assertEquals(0, $errors); $versionParameter->setValue(null); $errors = $validator->validate($versionParameter)->count(); $this->assertEquals(0, $errors); $versionParameter->setValue('abc'); $errors = $validator->validate($versionParameter)->count(); $this->assertGreaterThan(0, $errors); } }