public static function create() { $faker = Factory::create(); $identifier = RoleId::generate(); $title = RoleTitle::fromNative($faker->word); $slug = RoleSlug::fromNative(Str::slug($title)); return Role::define($identifier, $title, $slug); }
public function setUp() { parent::setUp(); $this->id = RoleId::generate(); $this->title = RoleTitle::fromNative('Asdf Qwerty'); $this->slug = RoleSlug::fromNative(Str::slug($this->title->toString())); $this->role = Role::define($this->id, $this->title, $this->slug); }
/** @test */ public function should_test_equality() { $one = RoleId::fromString('d16f9fe7-e947-460e-99f6-2d64d65f46bc'); $two = RoleId::fromString('d16f9fe7-e947-460e-99f6-2d64d65f46bc'); $three = RoleId::generate(); $this->assertTrue($one->equals($two)); $this->assertFalse($one->equals($three)); }