You are here

protected function SocialUserNameConstraintTest::buildViolationList in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  2. 8.2 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  3. 8.3 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  4. 8.4 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  5. 8.5 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  6. 8.6 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  7. 8.7 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  8. 8.8 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  9. 10.3.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  10. 10.0.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  11. 10.1.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()
  12. 10.2.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::buildViolationList()

Builds a list interface to return violations.

Parameters

int $number_of_items: Number of items you want to build in the list.

Return value

ConstraintViolationListInterface Mock constraintViolationItems with the count of $number_of_items.

1 call to SocialUserNameConstraintTest::buildViolationList()
SocialUserNameConstraintTest::providerTestValidate in modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php
Data provider for ::testValidate().

File

modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php, line 201

Class

SocialUserNameConstraintTest
@coversDefaultClass \Drupal\social_user\Plugin\Validation\Constraint\SocialUserNameConstraintValidator

Namespace

Drupal\social_user\Tests

Code

protected function buildViolationList($number_of_items) {
  $violationList = [];
  for ($count = 0; $count < $number_of_items; $count++) {
    $violation = $this
      ->getMock('Symfony\\Component\\Validator\\ConstraintViolationInterface');
    $violationList[] = $violation;
  }
  return $violationList;
}