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); }
/** * Get the Role's title * * @return string */ public function title() { return RoleTitle::fromNative($this->title); }
/** @test */ public function should_create_from_native() { $role_title = RoleTitle::fromNative('Fake Role Title'); $this->assertInstanceOf('Cffs\\Domain\\Model\\Identity\\RoleTitle', $role_title); }