Skip to content

Commit

Permalink
change assertRegExp() => assertMatchesRegularExpression()
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Gribanov committed Nov 18, 2024
1 parent 2bcc3f9 commit 61ef19d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/Downloader/MaxMindDownloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public function testNotFoundDatabase(): void
$this->assertIsString($files[0]);
$this->assertIsString($files[1]);
$this->assertIsString($files[2]);
$this->assertRegExp($tmp_zip_regexp, $files[0]);
$this->assertRegExp($tmp_unzip_regexp, $files[1]);
$this->assertRegExp($tmp_untar_regexp, $files[2]);
$this->assertMatchesRegularExpression($tmp_zip_regexp, $files[0]);
$this->assertMatchesRegularExpression($tmp_unzip_regexp, $files[1]);
$this->assertMatchesRegularExpression($tmp_untar_regexp, $files[2]);
});
$this->fs
->expects($this->at($fs_call++))
Expand All @@ -96,7 +96,7 @@ public function testNotFoundDatabase(): void
$this->assertSame($url, $origin_file);
$this->assertIsString($target_file);
$this->assertTrue($overwrite_newer_files);
$this->assertRegExp($tmp_zip_regexp, $target_file);
$this->assertMatchesRegularExpression($tmp_zip_regexp, $target_file);

// make test GeoLite2 db
file_put_contents($target_file, base64_decode(self::TAR_GZ_BAD));
Expand Down Expand Up @@ -137,9 +137,9 @@ public function testDownload(): void
$this->assertIsString($files[0]);
$this->assertIsString($files[1]);
$this->assertIsString($files[2]);
$this->assertRegExp($tmp_zip_regexp, $files[0]);
$this->assertRegExp($tmp_unzip_regexp, $files[1]);
$this->assertRegExp($tmp_untar_regexp, $files[2]);
$this->assertMatchesRegularExpression($tmp_zip_regexp, $files[0]);
$this->assertMatchesRegularExpression($tmp_unzip_regexp, $files[1]);
$this->assertMatchesRegularExpression($tmp_untar_regexp, $files[2]);
});
$this->fs
->expects($this->at($fs_call++))
Expand All @@ -151,7 +151,7 @@ public function testDownload(): void
$this->assertSame($url, $origin_file);
$this->assertIsString($target_file);
$this->assertTrue($overwrite_newer_files);
$this->assertRegExp($tmp_zip_regexp, $target_file);
$this->assertMatchesRegularExpression($tmp_zip_regexp, $target_file);

// make test GeoLite2 db
file_put_contents($target_file, base64_decode(self::TAR_GZ));
Expand All @@ -175,7 +175,7 @@ public function testDownload(): void
'#^%s/[\da-f]+\.\d+_GeoLite2/GeoLite2-City_20200114/GeoLite2.mmdb$#',
$path_quote
);
$this->assertRegExp($regexp, $origin_file);
$this->assertMatchesRegularExpression($regexp, $origin_file);
$this->assertFileExists($origin_file);
$this->assertSame('TestGeoLite2', file_get_contents($origin_file));
});
Expand All @@ -195,9 +195,9 @@ public function testDownload(): void
$this->assertIsString($files[0]);
$this->assertIsString($files[1]);
$this->assertIsString($files[2]);
$this->assertRegExp($tmp_zip_regexp, $files[0]);
$this->assertRegExp($tmp_unzip_regexp, $files[1]);
$this->assertRegExp($tmp_untar_regexp, $files[2]);
$this->assertMatchesRegularExpression($tmp_zip_regexp, $files[0]);
$this->assertMatchesRegularExpression($tmp_unzip_regexp, $files[1]);
$this->assertMatchesRegularExpression($tmp_untar_regexp, $files[2]);
});

$this->downloader->download($url, $target);
Expand Down

0 comments on commit 61ef19d

Please sign in to comment.