Skip to content

Commit

Permalink
Assert method replacement and test optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
beniamin-gheorghita-payu-gpo committed Aug 16, 2023
1 parent d9f5cc5 commit e4ab590
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests-integration/AfterScriptRunTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testDataIsAnonymized(): void
}

if ($destRow['Email'] !== null) {
$this->assertRegExp(
$this->assertMatchesRegularExpression(
'/^.+\@\S+\.\S+$/',
$destRow['Email'],
"Email at PK{$destRow['PrimaryKey']} is not a valid email !"
Expand Down
5 changes: 2 additions & 3 deletions tests/AnonymizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function setUp(): void
public function testRun(): void
{
$inputStream = $this->makeInputStream(['line1', 'line2']);
$outputStream = $this->makeOutputStream([]);
$outputStream = $this->makeOutputStream();

$data = [
'table1' => [
Expand Down Expand Up @@ -291,10 +291,9 @@ private function makeInputStream(array $lines)
return $fp;
}

private function makeOutputStream(array $lines)
private function makeOutputStream()
{
$fp = fopen('php://memory', 'ab+');
fwrite($fp, implode("\n", $lines));
rewind($fp);

return $fp;
Expand Down

0 comments on commit e4ab590

Please sign in to comment.