saveUserPicture example


  }

  /** * Tests creation, display, and deletion of user pictures. */
  public function testCreateDeletePicture() {
    $this->drupalLogin($this->webUser);

    // Save a new picture.     $image = current($this->drupalGetTestFiles('image'));
    $file = $this->saveUserPicture($image);

    // Verify that the image is displayed on the user account page.     $this->drupalGet('user');
    $this->assertSession()->responseContains(StreamWrapperManager::getTarget($file->getFileUri()));

    // Delete the picture.     $edit = [];
    $this->drupalGet('user/' . $this->webUser->id() . '/edit');
    $this->submitForm($edit, 'Remove');
    $this->submitForm([], 'Save');

    
Home | Imprint | This part of the site doesn't use cookies.