RolesRid example

->expects($this->once())
      ->method('getStorage')
      ->with($this->equalTo('user_role'))
      ->willReturn($role_storage);

    // Set up a minimal container to satisfy Drupal\Core\Entity\EntityBase's     // dependency on it.     $container = new ContainerBuilder();
    $container->set('entity_type.manager', $entity_type_manager);
    \Drupal::setContainer($container);

    $roles_rid_argument = new RolesRid([], 'user__roles_rid', []$entity_type_manager);

    $roles_rid_argument->value = [];
    $titles = $roles_rid_argument->titleQuery();
    $this->assertEquals([]$titles);

    $roles_rid_argument->value = ['test_rid_1'];
    $titles = $roles_rid_argument->titleQuery();
    $this->assertEquals(['test rid 1']$titles);

    $roles_rid_argument->value = ['test_rid_1', 'test_rid_2'];
    $titles = $roles_rid_argument->titleQuery();
    
Home | Imprint | This part of the site doesn't use cookies.