public function DiagnosticCheckTestBase::setUp in CloudFlare 8
Overrides UnitTestCase::setUp
1 call to DiagnosticCheckTestBase::setUp()
- DailyTagPurgeLimitCheckTest::setUp in modules/
cloudflarepurger/ tests/ src/ Unit/ DailyTagPurgeLimitCheckTest.php
1 method overrides DiagnosticCheckTestBase::setUp()
- DailyTagPurgeLimitCheckTest::setUp in modules/
cloudflarepurger/ tests/ src/ Unit/ DailyTagPurgeLimitCheckTest.php
File
- modules/
cloudflarepurger/ tests/ src/ Unit/ DiagnosticCheckTestBase.php, line 56
Class
- DiagnosticCheckTestBase
- Tests that purge_requirements() passes on our diagnostic checks.
Namespace
Drupal\Tests\cloudflarepurger\UnitCode
public function setUp() {
parent::setUp();
$this->drupalState = new CoreState(new KeyValueMemoryFactory(), new MemoryBackend('test'), new NullLockBackend());
$this->timestampStub = $this
->getMockBuilder('Drupal\\cloudflare\\Timestamp')
->disableOriginalConstructor()
->getMock();
$this->cloudflareState = new CloudFlareState($this->drupalState, $this->timestampStub);
$this->container = new ContainerBuilder();
$this->container
->set('string_translation', $this
->getStringTranslationStub());
$this->composerDependencyStub = $this
->createMock('\\Drupal\\cloudflare\\CloudFlareComposerDependenciesCheckInterface');
$this->composerDependencyStub
->expects($this
->any())
->method('check')
->will($this
->returnValue(TRUE));
$this->container
->set('cloudflare.composer_dependency_check', $this->composerDependencyStub);
\Drupal::setContainer($this->container);
}