Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
85170c95
Commit
85170c95
authored
Jan 23, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2108573
by pwolanin, swentel: Password-hash.sh is broken.
parent
ae1a458d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
4 deletions
+65
-4
core/modules/system/lib/Drupal/system/Tests/System/ScriptTest.php
...ules/system/lib/Drupal/system/Tests/System/ScriptTest.php
+59
-0
core/scripts/password-hash.sh
core/scripts/password-hash.sh
+6
-4
No files found.
core/modules/system/lib/Drupal/system/Tests/System/ScriptTest.php
0 → 100644
View file @
85170c95
<?php
/**
* @file
* Contains \Drupal\system\Tests\System\ScriptTest.
*/
namespace
Drupal\system\Tests\System
;
use
Drupal\simpletest\UnitTestBase
;
/**
* Tests core shell scripts.
*/
class
ScriptTest
extends
UnitTestBase
{
/**
* {@inheritdoc}
*/
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Shell scripts'
,
'description'
=>
'Tests Core utility shell scripts.'
,
'group'
=>
'System'
,
);
}
/**
* {@inheritdoc}
*/
public
function
setUp
()
{
parent
::
setUp
();
$path_parts
=
explode
(
DIRECTORY_SEPARATOR
,
__DIR__
);
// This file is 8 levels below the Drupal root.
$root
=
implode
(
DIRECTORY_SEPARATOR
,
array_slice
(
$path_parts
,
0
,
-
8
));
chdir
(
$root
);
}
/**
* Tests password-hash.sh.
*/
public
function
testPasswordHashSh
()
{
$cmd
=
'core/scripts/password-hash.sh xyz'
;
exec
(
$cmd
,
$output
,
$exit_code
);
$this
->
assertIdentical
(
0
,
$exit_code
,
'Exit code'
);
$this
->
assertTrue
(
strpos
(
implode
(
' '
,
$output
),
'hash: $S$'
)
!==
FALSE
);
}
/**
* Tests rebuild_token_calculator.sh.
*/
public
function
testRebuildTokenCalculatorSh
()
{
$cmd
=
'core/scripts/rebuild_token_calculator.sh'
;
exec
(
$cmd
,
$output
,
$exit_code
);
$this
->
assertIdentical
(
0
,
$exit_code
,
'Exit code'
);
$this
->
assertTrue
(
strpos
(
implode
(
' '
,
$output
),
'token='
)
!==
FALSE
);
}
}
core/scripts/password-hash.sh
View file @
85170c95
#!/usr/bin/php
#!/usr/bin/
env
php
<?php
/
**
...
...
@@ -78,10 +78,12 @@
}
}
chdir('
..
');
$core = dirname(__DIR__);
include_once $core . '
/includes/password.inc
';
include_once $core . '
/includes/bootstrap.inc
';
require_once $core . '
/vendor/autoload.php
';
require_once $core . '
/includes/bootstrap.inc
';
// Bootstrap the code so we have the container.
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
$password_hasher = \Drupal::service('
password
');
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment