/**
   * Testing focal point validation.
   *
   * @covers ::validateFocalPoint
   *
   * @dataProvider providerValidateFocalPoint
   */
  public function testValidateFocalPoint($value, $is_valid) {
    $this->testElement['#value'] = $value;

    // Test that an invalid focal point value sets a form error and a valid
    // focal point value does not.
    if ($is_valid === TRUE) {
      $this->testFormState->expects($this->never())
        ->method('setError');
    }
    else {
      $this->testFormState->expects($this->once())
        ->method('setError')
        ->will($this->returnSelf());
    }

    $element = [
      '#title' => 'foo',
      '#value' => $value,
    ];

    // Create a focal point image widget and test the validate method.
    $focalPointImageWidget = new FocalPointImageWidget(array(), array(), $this->prophesize(FieldDefinitionInterface::class)->reveal(), array(), array(), $this->prophesize(ElementInfoManagerInterface::class)->reveal());
    $focalPointImageWidget::validateFocalPoint($element, $this->testFormState);
  }