Skip to content
Snippets Groups Projects
Commit 7f4876c8 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2261477 by sun, neclimdul: Remove broken Drupal\system\Tests\ScriptTest.

parent ce842f88
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?php
/**
* @file
* Contains \Drupal\system\Tests\System\ScriptTest.
*/
namespace Drupal\system\Tests\System;
use Drupal\simpletest\DrupalUnitTestBase;
/**
* Tests core shell scripts.
*
* @group system
*/
class ScriptTest extends DrupalUnitTestBase {
protected function setUp() {
parent::setUp();
require_once DRUPAL_ROOT . '/core/includes/install.inc';
}
/**
* Tests password-hash.sh.
*/
public function testPasswordHashSh() {
// The script requires a settings.php with a hash salt setting.
$filename = $this->siteDirectory . '/settings.php';
touch($filename);
$settings['settings']['hash_salt'] = (object) array(
'value' => 'some_random_key',
'required' => TRUE,
);
drupal_rewrite_settings($settings, $filename);
$_SERVER['argv'] = array(
'core/scripts/password-hash.sh',
'xyz',
);
ob_start();
include DRUPAL_ROOT . '/core/scripts/password-hash.sh';
$this->setRawContent(ob_get_contents());
ob_end_clean();
$this->assertRaw('hash: $S$');
}
/**
* Tests rebuild_token_calculator.sh.
*/
public function testRebuildTokenCalculatorSh() {
// The script requires a settings.php with a hash salt setting.
$filename = $this->siteDirectory . '/settings.php';
touch($filename);
$settings['settings']['hash_salt'] = (object) array(
'value' => 'some_random_key',
'required' => TRUE,
);
drupal_rewrite_settings($settings, $filename);
$_SERVER['argv'] = array(
'core/scripts/rebuild_token_calculator.sh',
);
ob_start();
include DRUPAL_ROOT . '/core/scripts/rebuild_token_calculator.sh';
$this->setRawContent(ob_get_contents());
ob_end_clean();
$this->assertRaw('token=');
}
}
......@@ -11,10 +11,7 @@
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
// Check for $_SERVER['argv'] instead of PHP_SAPI === 'cli' to allow this script
// to be tested with the Simpletest UI test runner.
// @see \Drupal\system\Tests\System\ScriptTest
if (!isset($_SERVER['argv']) || !is_array($_SERVER['argv'])) {
if (PHP_SAPI !== 'cli') {
return;
}
......
......@@ -11,10 +11,7 @@
use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request;
// Check for $_SERVER['argv'] instead of PHP_SAPI === 'cli' to allow this script
// to be tested with the Simpletest UI test runner.
// @see \Drupal\system\Tests\System\ScriptTest
if (!isset($_SERVER['argv']) || !is_array($_SERVER['argv'])) {
if (PHP_SAPI !== 'cli') {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment