Skip to content

Commit

Permalink
Fix 5.3 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 8, 2020
1 parent caed5ff commit df93a5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Composer/Installers/Test/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ protected function ensureDirectoryExistsAndClear($directory)
mkdir($directory, 0777, true);
}

// polyfills for old phpunit for 5.3 support

/**
* @param string $exception
* @param string|null $message
Expand All @@ -84,4 +86,17 @@ public function setExpectedException($exception, $message = null, $code = null)
parent::setExpectedException($exception, $message, $code);
}
}

/**
* @param string $needle
* @param string $haystack
* @param string $message
*
* @return void
*/
public static function assertStringContainsString($needle, $haystack, $message = '')
{
$constraint = new StringContains($needle, false);
static::assertThat($haystack, $constraint, $message);
}
}

0 comments on commit df93a5b

Please sign in to comment.