TYPO3 CMS  TYPO3_6-2
DocumentTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $fixture;
26 
27  public function setUp() {
28  $this->fixture = new \TYPO3\CMS\Documentation\Domain\Model\Document();
29  }
30 
35  $this->fixture->setPackageKey('Conceived at T3DD13');
36 
37  $this->assertSame(
38  'Conceived at T3DD13',
39  $this->fixture->getPackageKey()
40  );
41  }
42 
46  public function setIconForStringSetsTitle() {
47  $this->fixture->setIcon('Conceived at T3DD13');
48 
49  $this->assertSame(
50  'Conceived at T3DD13',
51  $this->fixture->getIcon()
52  );
53  }
54 
59  $newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
60  $this->assertEquals(
61  $newObjectStorage,
62  $this->fixture->getTranslations()
63  );
64  }
65 
70  $translation = new \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation();
71  $objectStorageHoldingExactlyOneTranslations = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
72  $objectStorageHoldingExactlyOneTranslations->attach($translation);
73  $this->fixture->setTranslations($objectStorageHoldingExactlyOneTranslations);
74 
75  $this->assertSame(
76  $objectStorageHoldingExactlyOneTranslations,
77  $this->fixture->getTranslations()
78  );
79  }
80 
85  $translation = new \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation();
86  $objectStorageHoldingExactlyOneTranslation = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
87  $objectStorageHoldingExactlyOneTranslation->attach($translation);
88  $this->fixture->addTranslation($translation);
89 
90  $this->assertEquals(
91  $objectStorageHoldingExactlyOneTranslation,
92  $this->fixture->getTranslations()
93  );
94  }
95 
100  $translation = new \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation();
101  $localObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
102  $localObjectStorage->attach($translation);
103  $localObjectStorage->detach($translation);
104  $this->fixture->addTranslation($translation);
105  $this->fixture->removeTranslation($translation);
106 
107  $this->assertEquals(
108  $localObjectStorage,
109  $this->fixture->getTranslations()
110  );
111  }
112 
113 }