for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace StraTDeS\VO\Tests;
use StraTDeS\VO\Name;
use PHPUnit\Framework\TestCase;
class NameTest extends TestCase
{
public function testGivenAValidNameAValidVOIsReturned(): void
// Arrange
$name = "John Smith";
// Act
$nameVO = Name::fromValue($name);
// Assert
$this->assertInstanceOf(Name::class, $nameVO);
$this->assertEquals($name, $nameVO->value());
}
public function testGivenAnInvalidEmailAnExceptionIsThrown(): void
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Name value must have at least one character");
$name = "";
Name::fromValue($name);