public function TelephoneTest::testPrepareValue in Feeds 8.3
@covers ::prepareValue @dataProvider dataProviderPrepareValue
File
- tests/
src/ Unit/ Feeds/ Target/ TelephoneTest.php, line 24
Class
- TelephoneTest
- @coversDefaultClass \Drupal\feeds\Feeds\Target\Telephone @group feeds
Namespace
Drupal\Tests\feeds\Unit\Feeds\TargetCode
public function testPrepareValue($expected, $value) {
$method = $this
->getMethod('Drupal\\feeds\\Feeds\\Target\\Telephone', 'prepareTarget')
->getClosure();
$field_definition = $this
->getMockFieldDefinition();
$field_definition
->expects($this
->any())
->method('getType')
->will($this
->returnValue('string'));
$configuration = [
'feed_type' => $this
->createMock('Drupal\\feeds\\FeedTypeInterface'),
'target_definition' => $method($field_definition),
];
$target = new Telephone($configuration, 'telephone', []);
$method = $this
->getProtectedClosure($target, 'prepareValue');
$values = [
'value' => $value,
];
$method(0, $values);
$this
->assertSame($expected, $values['value']);
}