function testGetTranslatedLanguages() { $origPage = $this->objFromFixture('Page', 'testpage_en'); // through createTranslation() $translationAf = $origPage->createTranslation('af_ZA'); // create a new language on an unrelated page which shouldnt be returned from $origPage $otherPage = new Page(); $otherPage->write(); $otherTranslationEs = $otherPage->createTranslation('es_ES'); $this->assertEquals($origPage->getTranslatedLangs(), array('af_ZA'), 'Language codes are returned specifically for the queried page through getTranslatedLangs()'); $pageWithoutTranslations = new Page(); $pageWithoutTranslations->write(); $this->assertEquals($pageWithoutTranslations->getTranslatedLangs(), array(), 'A page without translations returns empty array through getTranslatedLangs(), ' . 'even if translations for other pages exist in the database'); // manual creation of page without an original link $translationDeWithoutOriginal = new Page(); $translationDeWithoutOriginal->Locale = 'de_DE'; $translationDeWithoutOriginal->write(); $this->assertEquals($translationDeWithoutOriginal->getTranslatedLangs(), array(), 'A translated page without an original doesn\'t return anything through getTranslatedLang()'); }