diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
index c23631c7b5483b3eb209028d1fc31981d11ec088..1996bc9ae42e76689793f772e507008d6347db37 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
@@ -250,7 +250,7 @@ public function testUnmanagedGitIgnoreWhenGitNotAvailable() {
   - Copy [web-root]/robots.txt from assets/robots-default.txt
 
 EOT;
-    $this->assertEquals($expected, $output);
+    $this->assertStringContainsString($expected, $output);
     $this->assertFileExists($sut . '/docroot/index.php');
     $this->assertFileDoesNotExist($sut . '/docroot/sites/default/.gitignore');
   }