예제 #1
0
 /** @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());
 }
예제 #2
0
파일: Setting.php 프로젝트: kfuchs/cribbb
 /**
  * Set the id
  *
  * @param SettingId $id
  * @return void
  */
 private function setId(SettingId $id)
 {
     $this->id = $id->toString();
 }
예제 #3
0
 /** @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);
 }