public function FeedTest::testClearStates in Feeds 8.3
@covers ::clearStates
File
- tests/
src/ Kernel/ Entity/ FeedTest.php, line 403
Class
- FeedTest
- @coversDefaultClass \Drupal\feeds\Entity\Feed @group feeds
Namespace
Drupal\Tests\feeds\Kernel\EntityCode
public function testClearStates() {
$feed = $this
->createFeed($this->feedType
->id());
// Set a state.
$state = $this
->createMock(StateInterface::class);
$feed
->setState(StateInterface::FETCH, $state);
$this
->assertSame($state, $feed
->getState(StateInterface::FETCH));
// Clear states.
$feed
->clearStates();
$this
->assertNotSame($state, $feed
->getState(StateInterface::FETCH));
}