PhpSapiTest.php in Automatic Updates 8
File
tests/src/Kernel/ReadinessChecker/PhpSapiTest.php
View source
<?php
namespace Drupal\Tests\automatic_updates\Kernel\ReadinessChecker;
use Drupal\KernelTests\KernelTestBase;
class PhpSapiTest extends KernelTestBase {
public static $modules = [
'automatic_updates',
];
public function testPhpSapiChanges() {
$messages = $this->container
->get('automatic_updates.php_sapi')
->run();
$this
->assertEmpty($messages);
$messages = $this->container
->get('automatic_updates.php_sapi')
->run();
$this
->assertEmpty($messages);
$this->container
->get('state')
->set('automatic_updates.php_sapi', 'foo');
$messages = $this->container
->get('automatic_updates.php_sapi')
->run();
self::assertEquals('PHP changed from running as "foo" to "cli". This can lead to inconsistent and misleading results.', $messages[0]);
}
}
Classes
Name |
Description |
PhpSapiTest |
Tests what happens when PHP SAPI changes from one value to another. |