コード例 #1
0
 public function testStatuses()
 {
     $user = new User();
     $status = new Status();
     $this->assertNotContains($status, $user->getStatuses());
     $this->assertNull($user->getCurrentStatus());
     $user->addStatus($status);
     $user->setCurrentStatus($status);
     $this->assertContains($status, $user->getStatuses());
     $this->assertEquals($status, $user->getCurrentStatus());
     $user->setCurrentStatus();
     $this->assertNull($user->getCurrentStatus());
     $user->getStatuses()->clear();
     $this->assertNotContains($status, $user->getStatuses());
 }