public function FeedsSubscriberTest::callbackWithTamperItem in Feeds Tamper 8.2
Callback for testAfterParseWithTamperItem().
File
- tests/
src/ Unit/ EventSubscriber/ FeedsSubscriberTest.php, line 260
Class
- FeedsSubscriberTest
- @coversDefaultClass \Drupal\feeds_tamper\EventSubscriber\FeedsSubscriber @group feeds_tamper
Namespace
Drupal\Tests\feeds_tamper\Unit\EventSubscriberCode
public function callbackWithTamperItem($data, TamperableFeedItemAdapter $item) {
// Add "ing" to each property.
foreach ($item
->getSource() as $key => $value) {
$item
->setSourceProperty($key, $value . 'ing');
}
// Make sure that "ing" is also added to the field that is being tampered.
return $data . 'ing';
}