CRM-12460
authorAS <as@dell12.(none)>
Mon, 29 Apr 2013 21:56:33 +0000 (14:56 -0700)
committerAS <as@dell12.(none)>
Mon, 29 Apr 2013 21:56:33 +0000 (14:56 -0700)
Fixed: phpunit doesn't get mysql password from civicrm.settings.local.php

----------------------------------------
* CRM-12460: phpunit doesn't get mysql password from civicrm.settings.local.php
  http://issues.civicrm.org/jira/browse/CRM-12460

tests/phpunit/CiviTest/civicrm.settings.dist.php

index 6c19c4caf55c511f7b44eb3b9974f5e361df5f3e..96ef2d551ab7e5b25b700fbb0c210ac58f281f22 100644 (file)
@@ -8,6 +8,9 @@
 
 if ( ! defined( 'CIVICRM_DSN' ) && ! empty( $GLOBALS['mysql_user'] ) ) {
   $dbName = ! empty( $GLOBALS['mysql_db'] ) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev';
+  if ( empty( $GLOBALS['mysql_pass'] ) && $GLOBALS['mysql_pass_need_password'] ) {
+    $GLOBALS['mysql_pass'] = PHPUnit_TextUI_Command::getPassword( 'Password' );
+  }
   define( 'CIVICRM_DSN'          , "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true" );
 }