TYPO3 CMS  TYPO3_6-2
DocumentTranslationTest.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\DocumentTranslation();
29  }
30 
34  public function setLanguageForStringSetsLocale() {
35  $this->fixture->setLanguage('Conceived at T3DD13');
36 
37  $this->assertSame(
38  'Conceived at T3DD13',
39  $this->fixture->getLanguage()
40  );
41  }
42 
46  public function setTitleForStringSetsTitle() {
47  $this->fixture->setTitle('Conceived at T3DD13');
48 
49  $this->assertSame(
50  'Conceived at T3DD13',
51  $this->fixture->getTitle()
52  );
53  }
54 
59  $newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
60  $this->assertEquals(
61  $newObjectStorage,
62  $this->fixture->getFormats()
63  );
64  }
65 
70  $format = new \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat();
71  $objectStorageHoldingExactlyOneFormats = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
72  $objectStorageHoldingExactlyOneFormats->attach($format);
73  $this->fixture->setFormats($objectStorageHoldingExactlyOneFormats);
74 
75  $this->assertSame(
76  $objectStorageHoldingExactlyOneFormats,
77  $this->fixture->getFormats()
78  );
79  }
80 
85  $format = new \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat();
86  $objectStorageHoldingExactlyOneFormat = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
87  $objectStorageHoldingExactlyOneFormat->attach($format);
88  $this->fixture->addFormat($format);
89 
90  $this->assertEquals(
91  $objectStorageHoldingExactlyOneFormat,
92  $this->fixture->getFormats()
93  );
94  }
95 
100  $format = new \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat();
101  $localObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
102  $localObjectStorage->attach($format);
103  $localObjectStorage->detach($format);
104  $this->fixture->addFormat($format);
105  $this->fixture->removeFormat($format);
106 
107  $this->assertEquals(
108  $localObjectStorage,
109  $this->fixture->getFormats()
110  );
111  }
112 
113 }