/** @test */ public function should_create_setting() { $setting = new Setting(SettingId::generate(), $this->user, 'new_follower'); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\Setting', $setting); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\SettingId', $setting->id()); $this->assertInstanceOf('Cribbb\\Domain\\Model\\Identity\\User', $setting->user()); $this->assertEquals('new_follower', $setting->key()); }
/** * Set the id * * @param SettingId $id * @return void */ private function setId(SettingId $id) { $this->id = $id->toString(); }
/** @test */ public function should_return_id_as_string() { $id = SettingId::fromString('d16f9fe7-e947-460e-99f6-2d64d65f46bc'); $this->assertEquals('d16f9fe7-e947-460e-99f6-2d64d65f46bc', $id->toString()); $this->assertEquals('d16f9fe7-e947-460e-99f6-2d64d65f46bc', (string) $id); }