public function ClientIpRestoreTest::setUp in CloudFlare 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ ClientIpRestoreTest.php, line 31
Class
- ClientIpRestoreTest
- Tests functionality of CloudFlareState object.
Namespace
Drupal\Tests\cloudflare\UnitCode
public function setUp() {
parent::setUp();
$this->container = new ContainerBuilder();
$this->container
->set('string_translation', $this
->getStringTranslationStub());
$this->urlGenerator = $this
->createMock('Drupal\\Core\\Routing\\UrlGeneratorInterface');
$this->urlGenerator
->expects($this
->any())
->method('getPathFromRoute')
->with('cloudflare.admin_settings_form', [])
->willReturn('/admin/config/services/cloudflare');
$this->container
->set('url_generator', $this->urlGenerator);
\Drupal::setContainer($this->container);
}