You are here

public function DateTimeTest::testWithErrors in Feeds 8.3

Tests preparing a value that fails.

@covers ::prepareValue

File

tests/src/Unit/Feeds/Target/DateTimeTest.php, line 73

Class

DateTimeTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\DateTime @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

public function testWithErrors() {
  $configuration = [
    'feed_type' => $this->feedType,
    'target_definition' => $this->targetDefinition,
  ];
  $target = new DateTime($configuration, 'datetime', []);
  $method = $this
    ->getProtectedClosure($target, 'prepareValue');
  $values = [
    'value' => '2000-05-32',
  ];
  $method(0, $values);
  $this
    ->assertSame('', $values['value']);
}