You are here

protected function SocialUserNameConstraintTest::itemsMock in Open Social 8.2

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::itemsMock()
  2. 8 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  3. 8.3 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  4. 8.4 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  5. 8.5 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  6. 8.6 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  7. 8.7 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  8. 8.8 modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  9. 10.3.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  10. 10.0.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  11. 10.1.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
  12. 10.2.x modules/social_features/social_user/tests/src/Unit/Validation/Constraint/SocialUserNameConstraintTest.php \Drupal\social_user\Tests\SocialUserNameConstraintTest::itemsMock()
1 call to SocialUserNameConstraintTest::itemsMock()
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 175

Class

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

Namespace

Drupal\social_user\Tests

Code

protected function itemsMock($name) {
  $name_field = $this
    ->getMock('Drupal\\Core\\Field\\FieldItemInterface');
  $name_field
    ->expects($this
    ->any())
    ->method('__get')
    ->willReturn($name);
  $field_definition = $this
    ->getMock('Drupal\\Core\\Field\\FieldDefinitionInterface');
  $items = $this
    ->getMock('Drupal\\Core\\Field\\FieldItemListInterface');
  $items
    ->expects($this
    ->any())
    ->method('getFieldDefinition')
    ->willReturn($field_definition);
  $items
    ->expects($this
    ->any())
    ->method('first')
    ->willReturn($name_field);
  return $items;
}