forked from phpro/http-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinaryFileTest.php
More file actions
35 lines (29 loc) · 967 Bytes
/
BinaryFileTest.php
File metadata and controls
35 lines (29 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
namespace Phpro\HttpTools\Tests\Unit\Encoding\Binary;
use Phpro\HttpTools\Encoding\Binary\BinaryFile;
use Phpro\HttpTools\Test\UseHttpFactories;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
final class BinaryFileTest extends TestCase
{
use UseHttpFactories;
#[Test]
public function it_is_a_dto(): void
{
$dto = new BinaryFile(
$stream = $this->createStream(''),
$fileInBytes = 5,
$mimeType = 'mime',
$fileName = 'hello.jpg',
$extension = 'jpg',
$hash = 'md5'
);
self::assertSame($stream, $dto->stream());
self::assertSame($fileInBytes, $dto->fileSizeInBytes());
self::assertSame($mimeType, $dto->mimeType());
self::assertSame($fileName, $dto->fileName());
self::assertSame($extension, $dto->extension());
self::assertSame($hash, $dto->hash());
}
}