public function FeedClearHandlerTest::setUp in Feeds 8.3
Overrides FeedsUnitTestCase::setUp
File
- tests/
src/ Unit/ FeedClearHandlerTest.php, line 41
Class
- FeedClearHandlerTest
- @coversDefaultClass \Drupal\feeds\FeedClearHandler @group feeds
Namespace
Drupal\Tests\feeds\UnitCode
public function setUp() {
parent::setUp();
$this->dispatcher = new EventDispatcher();
$this->context = [];
$this->handler = $this
->getMockBuilder(FeedClearHandler::class)
->setConstructorArgs([
$this->dispatcher,
])
->setMethods([
'batchSet',
])
->getMock();
$this->handler
->setStringTranslation($this
->getStringTranslationStub());
$state = new State();
$this->feed = $this
->createMock('Drupal\\feeds\\FeedInterface');
$this->feed
->expects($this
->any())
->method('getState')
->with(StateInterface::CLEAR)
->will($this
->returnValue($state));
}