public function MessengerTest::testAddWithDuplicates in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php \Drupal\KernelTests\Core\Messenger\MessengerTest::testAddWithDuplicates()
- 9 core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php \Drupal\KernelTests\Core\Messenger\MessengerTest::testAddWithDuplicates()
Tests we do add duplicates with repeat flag.
@covers ::addStatus @covers ::addWarning @covers ::addError @covers ::deleteByType
File
- core/
tests/ Drupal/ KernelTests/ Core/ Messenger/ MessengerTest.php, line 107
Class
- MessengerTest
- @group Messenger @coversDefaultClass \Drupal\Core\Messenger\Messenger
Namespace
Drupal\KernelTests\Core\MessengerCode
public function testAddWithDuplicates() {
$this->messenger
->addStatus('Duplicated status message', TRUE);
$this->messenger
->addStatus('Duplicated status message', TRUE);
$this
->assertCount(2, $this->messenger
->deleteByType(MessengerInterface::TYPE_STATUS));
$this->messenger
->addWarning('Duplicated warning message', TRUE);
$this->messenger
->addWarning('Duplicated warning message', TRUE);
$this
->assertCount(2, $this->messenger
->deleteByType(MessengerInterface::TYPE_WARNING));
$this->messenger
->addError('Duplicated error message', TRUE);
$this->messenger
->addError('Duplicated error message', TRUE);
$this
->assertCount(2, $this->messenger
->deleteByType(MessengerInterface::TYPE_ERROR));
}