|
1 | 1 | <?php
|
2 | 2 | /**
|
3 | 3 | * conjoon
|
4 |
| - * php-ms-imapuser |
5 |
| - * Copyright (C) 2019-2021 Thorsten Suckow-Homberg https://github.com/conjoon/php-ms-imapuser |
| 4 | + * php-cn_imapuser |
| 5 | + * Copyright (C) 2019 Thorsten Suckow-Homberg https://github.com/conjoon/php-cn_imapuser |
6 | 6 | *
|
7 | 7 | * Permission is hereby granted, free of charge, to any person
|
8 | 8 | * obtaining a copy of this software and associated documentation
|
@@ -52,6 +52,38 @@ public function testInstance() {
|
52 | 52 | }
|
53 | 53 |
|
54 | 54 |
|
| 55 | + /** |
| 56 | + * Tests listToTre |
| 57 | + */ |
| 58 | + public function testListToTree_Entwürfe() { |
| 59 | + |
| 60 | + $builder = $this->createBuilder(); |
| 61 | + |
| 62 | + $mailFolderList = $this->createMailFolderList( |
| 63 | + ["Entwürfe", |
| 64 | + "Gelöschte Elemente"] |
| 65 | + ); |
| 66 | + |
| 67 | + $mailFolderChildList = $builder->listToTree($mailFolderList, [""]); |
| 68 | + |
| 69 | + $this->assertSame(1, count($mailFolderChildList)); |
| 70 | + |
| 71 | + $mailFolder = $mailFolderChildList[0]; |
| 72 | + $this->assertSame("Entwürfe", $mailFolder->getName()); |
| 73 | + $this->assertSame("Entwürfe", $mailFolder->getFolderKey()->getId()); |
| 74 | + $this->assertSame(MailFolder::TYPE_DRAFT, $mailFolder->getFolderType()); |
| 75 | + $children = $mailFolder->getData(); |
| 76 | + $this->assertSame(0, count($children)); |
| 77 | + |
| 78 | + $drafts = $mailFolderChildList[1]; |
| 79 | + $this->assertSame("Gelöschte Elemente", $drafts->getName()); |
| 80 | + $this->assertSame("Gelöschte Elemente", $drafts->getFolderKey()->getId()); |
| 81 | + $this->assertSame(MailFolder::TYPE_TRASH, $drafts->getFolderType()); |
| 82 | + $children = $drafts->getData(); |
| 83 | + $this->assertSame(0, count($children)); |
| 84 | + } |
| 85 | + |
| 86 | + |
55 | 87 | /**
|
56 | 88 | * Tests listToTre
|
57 | 89 | */
|
|
0 commit comments