You are here

public function FeedTest::testGetStateAfterSettingStateToNull in Feeds 8.3

@covers ::getState

File

tests/src/Kernel/Entity/FeedTest.php, line 370

Class

FeedTest
@coversDefaultClass \Drupal\feeds\Entity\Feed @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Entity

Code

public function testGetStateAfterSettingStateToNull() {
  $feed = $this
    ->createFeed($this->feedType
    ->id());

  // Explicitly set a state to NULL.
  $feed
    ->setState(StateInterface::PARSE, NULL);
  $feed
    ->saveStates();

  // Assert that getState() still returns an instance of StateInterface.
  $this
    ->assertInstanceOf(StateInterface::class, $feed
    ->getState(StateInterface::PARSE));
}