Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
axyr committed Jul 1, 2024
1 parent 8337798 commit b4109f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions tests/Servers/Disk/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class RepositoryTest extends TestCase
public function testItStoresAnEmailToTheDatabase(): void
{
$email = app(Repository::class)->create($this->emailContent);
$hash = md5($this->emailContent);

$this->assertEquals($this->now->format('YmdHisu') . '-3a18860163e7a2fc1dfe71162db4a24d-email', $email->id());
$this->assertEquals($this->now->format('YmdHisu') . '-' . $hash . '-email', $email->id());
$this->assertEquals($this->emailContent, $email->raw());
$this->assertEquals('"Mrs. Lavinia Pacocha" <[email protected]>', $email->from());
$this->assertEquals('Marshall Ryan <[email protected]>, Aracely Lebsack <[email protected]>', $email->to());
Expand Down Expand Up @@ -48,8 +49,8 @@ public function testItGetsAListOfPaginatedEmails(): void
public function testItFindsAndEmail(): void
{
app(Repository::class)->create($this->emailContent);

$fileName = $this->now->format('YmdHisu') . '-3a18860163e7a2fc1dfe71162db4a24d-email';
$hash = md5($this->emailContent);
$fileName = $this->now->format('YmdHisu') . '-' . $hash . '-email';

$this->assertTrue(app(Repository::class)->exists($fileName));
$this->assertEquals($fileName, app(Repository::class)->find($fileName)->id());
Expand All @@ -58,8 +59,9 @@ public function testItFindsAndEmail(): void
public function testItDeletesAndEmail(): void
{
app(Repository::class)->create($this->emailContent);
$hash = md5($this->emailContent);

$fileName = $this->now->format('YmdHisu') . '-3a18860163e7a2fc1dfe71162db4a24d-email';
$fileName = $this->now->format('YmdHisu') . '-' . $hash . '-email';

app(Repository::class)->delete($fileName);

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp(): void

Carbon::setTestNow($this->now = now());

$this->emailContent = file_get_contents(__DIR__ . '/fixtures/20240628175734592648-test-email-email');
$this->emailContent = file_get_contents(__DIR__ . '/fixtures/test-email');
}

protected function getPackageProviders($app)
Expand Down
File renamed without changes.

0 comments on commit b4109f3

Please sign in to comment.