function BanAdminTest::getIpManagerMock
Same name in other branches
- 11.x core/modules/ban/tests/src/Unit/BanAdminTest.php \Drupal\Tests\ban\Unit\BanAdminTest::getIpManagerMock()
Get the mocked IP manager service.
3 calls to BanAdminTest::getIpManagerMock()
- BanAdminTest::testIpValidation in core/
modules/ ban/ tests/ src/ Unit/ BanAdminTest.php - Tests various user input to confirm correct validation.
- BanAdminTest::testRouteParameter in core/
modules/ ban/ tests/ src/ Unit/ BanAdminTest.php - Test passing an IP address as a route parameter.
- BanAdminTest::testSubmit in core/
modules/ ban/ tests/ src/ Unit/ BanAdminTest.php - Test form submission.
File
-
core/
modules/ ban/ tests/ src/ Unit/ BanAdminTest.php, line 136
Class
- BanAdminTest
- Tests the BanAdmin form.
Namespace
Drupal\Tests\ban\UnitCode
protected function getIpManagerMock() : BanIpManagerInterface {
$manager = $this->createMock(BanIpManagerInterface::class);
$manager->expects($this->any())
->method('findAll')
->willReturn([]);
return $manager;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.