Ejemplo n.º 1
0
 /**
  * @depends testNotificationsBoxResolvesCorrectly
  */
 public function testSetAndGetMailbox()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $boxes = EmailBox::getAll();
     $this->assertEquals(1, count($boxes));
     $box = new EmailBox();
     $box->name = 'Some new mailbox';
     $saved = $box->save();
     $this->assertTrue($saved);
     $this->assertEquals(0, $box->folders->count());
     $this->assertTrue($box->isDeletable());
     //Now try deleting the box
     $boxes = EmailBox::getAll();
     $this->assertEquals(2, count($boxes));
     $box->delete();
     $boxes = EmailBox::getAll();
     $this->assertEquals(1, count($boxes));
 }