for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace PhpValueObjects\Tests\Identity;
use PhpValueObjects\Tests\BaseUnitTestCase;
final class EmailTest extends BaseUnitTestCase
{
/**
* @test
*/
public function itShouldReturnEmail(): void
$email = $this->faker()->email;
$emailVO = new Email($email);
$this->assertSame($email, $emailVO->value());
}
public function invalidEmailProvider(): array
return [
[$this->faker()->numberBetween()],
[$this->faker()->address],
];
*
* @dataProvider invalidEmailProvider
public function itShouldThrowsException(string $data): void
$this->expectException(\Exception::class);
new Email($data);