public function testPersonalOrigin() { $origin1 = new TestEmailOrigin(1); $origin1->setMailboxName('testName1'); $folder1 = new TestEmailFolder(1); $folder2 = new TestEmailFolder(2); $folder3 = new TestEmailFolder(3); $folder1->setFullName('Folder1'); $folder1->setSyncEnabled(true); $folder2->setFullName('Folder2'); $folder2->setSyncEnabled(true); $folder3->setFullName('Folder - disabled'); $origin1->addFolder($folder1); $origin1->addFolder($folder2); $origin1->addFolder($folder3); $origin2 = new TestEmailOrigin(2); $origin2->setMailboxName('testName2'); $origin2->setActive(false); $folder3 = new TestEmailFolder(3); $folder3->setSyncEnabled(true); $folder3->setFullName('Folder3'); $origin2->addFolder($folder3); $this->doctrine->expects($this->any())->method('getRepository')->will($this->returnValue($this->originRepository)); $this->originRepository->expects($this->once())->method('findBy')->willReturn([$origin1, $origin2]); $this->originRepository->expects($this->once())->method('findAvailableMailboxes')->willReturn([]); $result = $this->originFolderFilterProvider->getListTypeChoices(); $this->assertNotEmpty($result); $this->assertCount(2, $result); $this->assertEquals($origin1->isActive(), $result[$origin1->getMailboxName()]['active']); $this->assertEquals($origin2->isActive(), $result[$origin2->getMailboxName()]['active']); $this->assertCount(2, $result[$origin1->getMailboxName()]['folder']); $this->assertCount(1, $result[$origin2->getMailboxName()]['folder']); $this->assertEquals($folder2->getFullName(), $result[$origin1->getMailboxName()]['folder'][$folder2->getId()]); }
public function testIsActive() { $entity = new TestEmailOrigin(); // check that true by default $this->assertTrue($entity->isActive()); // check setter $entity->setActive(false); $this->assertFalse($entity->isActive()); }