You are here

protected function FeedsSubscriberTest::createTamperMock in Feeds Tamper 8.2

Creates a tamper mock with a return value for the tamper() method.

Parameters

mixed $return_value: (optional) The value that the tamper plugin must return when tamper() gets called on it.

Return value

\Drupal\tamper\TamperInterface A mocked tamper plugin.

3 calls to FeedsSubscriberTest::createTamperMock()
FeedsSubscriberTest::testAfterParse in tests/src/Unit/EventSubscriber/FeedsSubscriberTest.php
@covers ::afterParse @covers ::alterItem
FeedsSubscriberTest::testAfterParseWithEmptyArray in tests/src/Unit/EventSubscriber/FeedsSubscriberTest.php
@covers ::afterParse
FeedsSubscriberTest::testAfterParseWithNoItems in tests/src/Unit/EventSubscriber/FeedsSubscriberTest.php
@covers ::afterParse

File

tests/src/Unit/EventSubscriber/FeedsSubscriberTest.php, line 79

Class

FeedsSubscriberTest
@coversDefaultClass \Drupal\feeds_tamper\EventSubscriber\FeedsSubscriber @group feeds_tamper

Namespace

Drupal\Tests\feeds_tamper\Unit\EventSubscriber

Code

protected function createTamperMock($return_value = NULL) {
  $tamper = $this
    ->createMock(TamperInterface::class);
  $tamper
    ->expects($this
    ->any())
    ->method('tamper')
    ->will($this
    ->returnValue($return_value));
  return $tamper;
}