Commit e3ff27ca authored by Tobias Stoeckler's avatar Tobias Stoeckler

#958162 followup by sun, tstoeckler: Introduce 'machine name' property, fix...

#958162 followup by sun, tstoeckler: Introduce 'machine name' property, fix wrong assertion message.
parent 10a175b3
......@@ -200,6 +200,7 @@ function libraries_info($library = NULL) {
// Provide defaults.
foreach ($libraries as $name => &$properties) {
$properties += array(
'machine_name' => $name,
'name' => $name,
'vendor url' => '',
'download url' => '',
......@@ -259,7 +260,7 @@ function libraries_detect($libraries) {
*/
function libraries_detect_library(&$library) {
$library['installed'] = FALSE;
$name = $library['name'];
$name = $library['machine_name'];
// Check whether the library exists.
if (!isset($library['library path'])) {
......@@ -267,7 +268,9 @@ function libraries_detect_library(&$library) {
}
if (!file_exists($library['library path'])) {
$library['error'] = 'not found';
$library['error message'] = t('%library could not be found.', array('%library' => $library['name']));
$library['error message'] = t('%library could not be found.', array(
'%library' => $library['name'],
));
return;
}
......@@ -284,7 +287,9 @@ function libraries_detect_library(&$library) {
}
if (empty($library['version'])) {
$library['error'] = 'not detected';
$library['error message'] = t('The version of %library could not be detected.', array('%library' => $library['name']));
$library['error message'] = t('The version of %library could not be detected.', array(
'%library' => $library['name'],
));
return;
}
}
......
......@@ -207,7 +207,7 @@ class LibrariesTestCase extends DrupalWebTestCase {
// Test that the correct files are loaded.
foreach ($extensions as $extension) {
$message = "$filename.$extension found";
$message = "$name.$extension found";
$message = ($label !== '' ? "$label: $message" : $message);
$this->assertRaw("$name.$extension", $message);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment