Skip to content

Commit 8633944

Browse files
committed
fix tests in windows
1 parent 276d203 commit 8633944

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/Attachment/AttachmentTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ class AttachmentTest extends TestCase
1111
{
1212
public function testFileAttachment(): void
1313
{
14-
$file = tempnam(sys_get_temp_dir(), 'attachment.txt');
14+
// We use 3 char prefix because windows supports only 3
15+
$file = tempnam(sys_get_temp_dir(), 'att');
1516
file_put_contents($file, 'This is a temp attachment');
1617
$attachment = Attachment::fromFile($file);
1718
$this->assertEquals(25, $attachment->getSize());
1819
$this->assertEquals('This is a temp attachment', $attachment->getData());
19-
$this->assertStringStartsWith('attachment.txt', $attachment->getFilename());
20+
$this->assertStringStartsWith('att', $attachment->getFilename());
2021
$this->assertEquals('application/octet-stream', $attachment->getContentType());
2122
}
2223

0 commit comments

Comments
 (0)