-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add feature: detect mime type from file using finfo
- Loading branch information
1 parent
7c761d7
commit bd1c1cf
Showing
8 changed files
with
213 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Genkgo\TestMail\Unit\Header; | ||
|
||
use Genkgo\Mail\Header\HeaderValueParameter; | ||
use Genkgo\TestMail\AbstractTestCase; | ||
|
||
final class HeaderValueParameterTest extends AbstractTestCase | ||
{ | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_can_parse_a_string() | ||
{ | ||
$parameter = HeaderValueParameter::fromString('charset="utf-8"'); | ||
|
||
$this->assertEquals((string)$parameter, 'charset="utf-8"'); | ||
$this->assertEquals($parameter->getName(), 'charset'); | ||
$this->assertEquals($parameter->getValue(), 'utf-8'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_can_parse_an_unquoted_string() | ||
{ | ||
$parameter = HeaderValueParameter::fromString('charset=utf-8'); | ||
|
||
$this->assertEquals((string)$parameter, 'charset="utf-8"'); | ||
$this->assertEquals($parameter->getName(), 'charset'); | ||
$this->assertEquals($parameter->getValue(), 'utf-8'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_does_not_parse_invalid_values() | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
HeaderValueParameter::fromString('charset,utf-8'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters