public function testAddFolder()
 {
     $folder = new EmailFolder();
     $folder->setType('sent');
     $folder->setName('Test');
     $folder->setFullName('Test');
     $this->batch->addFolder($folder);
     $this->assertCount(1, ReflectionUtil::getProtectedProperty($this->batch, 'folders'));
     $this->assertEquals('Test', $this->batch->getFolder('sent', 'TeST')->getFullName());
     $this->assertNull($this->batch->getFolder('sent', 'Another'));
     $folder1 = new EmailFolder();
     $folder1->setType('trash');
     $folder1->setName('Test');
     $folder1->setFullName('Test');
     $this->batch->addFolder($folder1);
     $this->assertCount(2, ReflectionUtil::getProtectedProperty($this->batch, 'folders'));
     $this->assertEquals('Test', $this->batch->getFolder('trash', 'TeST')->getFullName());
     $this->assertNull($this->batch->getFolder('trash', 'Another'));
     $this->setExpectedException('LogicException');
     $folder2 = new EmailFolder();
     $folder2->setType('sent');
     $folder2->setName('TEST');
     $folder2->setFullName('TEST');
     $this->batch->addFolder($folder2);
 }
 public function testAddOrigin()
 {
     $origin = $this->getMockBuilder('Oro\\Bundle\\EmailBundle\\Entity\\EmailOrigin')->getMock();
     $origin->expects($this->any())->method('getId')->will($this->returnValue(1));
     $this->batch->addOrigin($origin);
     $this->assertCount(1, ReflectionUtil::getProtectedProperty($this->batch, 'origins'));
     $this->assertEquals(1, $this->batch->getOrigin(1)->getId());
     $this->assertNull($this->batch->getOrigin(123));
 }