Updated Rector to commit c6c1026bbeb8312e0f1598eb0d57f466b076f420

c6c1026bbe [DX] Cleanup AbstractRectorTestCase (#2882)
This commit is contained in:
Tomas Votruba 2022-09-01 15:18:01 +00:00
parent d82c31f345
commit 9632c3edb1
7 changed files with 22 additions and 22 deletions

View File

@ -13,8 +13,12 @@ final class FixtureTempFileDumper
public static function dump(string $fileContents, string $suffix = 'php') : string
{
// the "php" suffix is important, because that will hook into \Rector\Core\Application\FileProcessor\PhpFileProcessor
$temporaryFileName = \sys_get_temp_dir() . self::TEMP_FIXTURE_DIRECTORY . '/' . \md5($fileContents) . '.' . $suffix;
$temporaryFileName = self::getTempDirectory() . '/' . \md5($fileContents) . '.' . $suffix;
FileSystem::write($temporaryFileName, $fileContents);
return $temporaryFileName;
}
public static function getTempDirectory() : string
{
return \sys_get_temp_dir() . self::TEMP_FIXTURE_DIRECTORY;
}
}

View File

@ -123,13 +123,13 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
}
protected function getFixtureTempDirectory() : string
{
return \sys_get_temp_dir() . FixtureTempFileDumper::TEMP_FIXTURE_DIRECTORY;
return FixtureTempFileDumper::getTempDirectory();
}
private function resolveExpectedContents(string $filePath) : string
{
$contents = FileSystem::read($filePath);
// make sure we don't get a diff in which every line is different (because of differences in EOL)
return $this->normalizeNewlines($contents);
return \str_replace("\r\n", "\n", $contents);
}
private function resolveOriginalFixtureFileSuffix(string $filePath) : string
{
@ -172,10 +172,6 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
$this->assertStringMatchesFormat($contents, $changedContent);
}
}
private function normalizeNewlines(string $string) : string
{
return \str_replace("\r\n", "\n", $string);
}
private function processFilePath(string $filePath) : string
{
$this->dynamicSourceLocatorProvider->setFilePath($filePath);

View File

@ -48,7 +48,7 @@ abstract class AbstractTestCase extends TestCase
protected function getService(string $type) : object
{
if (self::$currentContainer === null) {
throw new ShouldNotHappenException('First, create container with "bootWithConfigFileInfos([...])"');
throw new ShouldNotHappenException('First, create container with "boot()" or "bootWithConfigFileInfos([...])"');
}
$object = self::$currentContainer->get($type);
if ($object === null) {

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '36ac5305f1b7b1007e4cbf6260695d2ae16fef5f';
public const PACKAGE_VERSION = 'c6c1026bbeb8312e0f1598eb0d57f466b076f420';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-09-01 11:43:47';
public const RELEASE_DATE = '2022-09-01 17:12:14';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26::getLoader();
return ComposerAutoloaderInit49c7847968b4d07e4659a00d91db5255::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26
class ComposerAutoloaderInit49c7847968b4d07e4659a00d91db5255
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit49c7847968b4d07e4659a00d91db5255', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit49c7847968b4d07e4659a00d91db5255', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit49c7847968b4d07e4659a00d91db5255::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit49c7847968b4d07e4659a00d91db5255::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire987a820e4ab42f95f863b0dee1fe6a26($fileIdentifier, $file);
composerRequire49c7847968b4d07e4659a00d91db5255($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit987a820e4ab42f95f863b0dee1fe6a26
* @param string $file
* @return void
*/
function composerRequire987a820e4ab42f95f863b0dee1fe6a26($fileIdentifier, $file)
function composerRequire49c7847968b4d07e4659a00d91db5255($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26
class ComposerStaticInit49c7847968b4d07e4659a00d91db5255
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3139,9 +3139,9 @@ class ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit987a820e4ab42f95f863b0dee1fe6a26::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit49c7847968b4d07e4659a00d91db5255::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit49c7847968b4d07e4659a00d91db5255::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit49c7847968b4d07e4659a00d91db5255::$classMap;
}, null, ClassLoader::class);
}