You are here

public function DateTimeTest::testYearValue in Feeds 8.3

Tests parsing a year value.

@covers ::prepareValue

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

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