diff --git a/core/tests/Drupal/Tests/Core/Utility/ScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ScriptTest.php similarity index 59% rename from core/tests/Drupal/Tests/Core/Utility/ScriptTest.php rename to core/modules/system/lib/Drupal/system/Tests/System/ScriptTest.php index e6bc43e..3069aab 100644 --- a/core/tests/Drupal/Tests/Core/Utility/ScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ScriptTest.php @@ -2,23 +2,26 @@ /** * @file - * Contains \Drupal\Tests\Core\Utility\ScriptTest. + * Contains \Drupal\system\Tests\System\ScriptTest. */ -namespace Drupal\Tests\Core\Utility; +namespace Drupal\system\Tests\System; -use Drupal\Tests\UnitTestCase; +use Drupal\simpletest\UnitTestBase; /** * Tests core shell scripts. */ -class ScriptTest extends UnitTestCase { +class ScriptTest extends UnitTestBase { + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Shell scripts', 'description' => 'Tests Core utility shell scripts.', - 'group' => 'Common', + 'group' => 'System', ); } @@ -28,8 +31,8 @@ public static function getInfo() { public function setUp() { parent::setUp(); $path_parts = explode(DIRECTORY_SEPARATOR, __DIR__); - // This file is 6 levels below the Drupal root. - $root = implode(DIRECTORY_SEPARATOR, array_slice($path_parts, 0, -6)); + // This file is 8 levels below the Drupal root. + $root = implode(DIRECTORY_SEPARATOR, array_slice($path_parts, 0, -8)); chdir($root); } @@ -39,8 +42,8 @@ public function setUp() { public function testPasswordHashSh() { $cmd = 'core/scripts/password-hash.sh xyz'; exec($cmd, $output, $exit_code); - $this->assertEquals(0, $exit_code, 'Exit code'); - $this->assertContains('hash: $S$', implode(' ', $output)); + $this->assertIdentical(0, $exit_code, 'Exit code'); + $this->assertTrue(strpos(implode(' ', $output), 'hash: $S$') !== FALSE); } /** @@ -49,8 +52,8 @@ public function testPasswordHashSh() { public function testRebuildTokenCalculatorSh() { $cmd = 'core/scripts/rebuild_token_calculator.sh'; exec($cmd, $output, $exit_code); - $this->assertEquals(0, $exit_code, 'Exit code'); - $this->assertContains('token=', implode(' ', $output)); + $this->assertIdentical(0, $exit_code, 'Exit code'); + $this->assertTrue(strpos(implode(' ', $output), 'token=') !== FALSE); } }