fixed new issue on rewriting test due to blank titles on some locale
This commit is contained in:
@@ -288,6 +288,7 @@ class ContentTest extends TestCaseWithURLToolSetup
|
|||||||
|
|
||||||
$this->assertNull($testAssociation);
|
$this->assertNull($testAssociation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Thelia\Model\Content
|
* @return \Thelia\Model\Content
|
||||||
*/
|
*/
|
||||||
@@ -320,9 +321,7 @@ class ContentTest extends TestCaseWithURLToolSetup
|
|||||||
$folder->setVisible(1);
|
$folder->setVisible(1);
|
||||||
$folder->setPosition(1);
|
$folder->setPosition(1);
|
||||||
|
|
||||||
$folder
|
$this->setI18N($folder, "folder");
|
||||||
->setLocale('en_US')
|
|
||||||
->setTitle('folder test');
|
|
||||||
|
|
||||||
$folder->save();
|
$folder->save();
|
||||||
|
|
||||||
@@ -334,9 +333,7 @@ class ContentTest extends TestCaseWithURLToolSetup
|
|||||||
$content->setVisible(1);
|
$content->setVisible(1);
|
||||||
$content->setPosition($i + 1);
|
$content->setPosition($i + 1);
|
||||||
|
|
||||||
$content
|
$this->setI18N($content, "content");
|
||||||
->setLocale('en_US')
|
|
||||||
->setTitle(sprintf('content test %s', $i));
|
|
||||||
|
|
||||||
$contentFolders = $content->getContentFolders();
|
$contentFolders = $content->getContentFolders();
|
||||||
$collection = new Collection();
|
$collection = new Collection();
|
||||||
@@ -353,6 +350,24 @@ class ContentTest extends TestCaseWithURLToolSetup
|
|||||||
return self::$folderForPositionTest;
|
return self::$folderForPositionTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the title of te object in all locales
|
||||||
|
*
|
||||||
|
* @param mixed $object
|
||||||
|
* @param string $title
|
||||||
|
*/
|
||||||
|
public function setI18N(&$object, $title)
|
||||||
|
{
|
||||||
|
|
||||||
|
$localeList = array('fr_FR', 'en_US', 'es_ES', 'it_IT');
|
||||||
|
|
||||||
|
foreach ($localeList as $locale) {
|
||||||
|
$object->setLocale($locale);
|
||||||
|
$object->setTitle($locale . ' : ' . $title);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Thelia\Model\Folder
|
* @return \Thelia\Model\Folder
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -297,9 +297,8 @@ class FolderTest extends TestCaseWithURLToolSetup
|
|||||||
$folder->setParent(0);
|
$folder->setParent(0);
|
||||||
$folder->setVisible(1);
|
$folder->setVisible(1);
|
||||||
$folder->setPosition(1);
|
$folder->setPosition(1);
|
||||||
$folder
|
|
||||||
->setLocale('en_US')
|
$this->setI18N($folder, "folder");
|
||||||
->setTitle('folder test');
|
|
||||||
|
|
||||||
$folder->save();
|
$folder->save();
|
||||||
|
|
||||||
@@ -311,9 +310,7 @@ class FolderTest extends TestCaseWithURLToolSetup
|
|||||||
$subFolder->setVisible(1);
|
$subFolder->setVisible(1);
|
||||||
$subFolder->setPosition($i + 1);
|
$subFolder->setPosition($i + 1);
|
||||||
|
|
||||||
$folder
|
$this->setI18N($subFolder, "sub folder");
|
||||||
->setLocale('en_US')
|
|
||||||
->setTitle(sprintf('folder test %s', $i));
|
|
||||||
|
|
||||||
$subFolder->save();
|
$subFolder->save();
|
||||||
}
|
}
|
||||||
@@ -324,6 +321,23 @@ class FolderTest extends TestCaseWithURLToolSetup
|
|||||||
return self::$folderIdForPositionTest;
|
return self::$folderIdForPositionTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the title of te object in all locales
|
||||||
|
*
|
||||||
|
* @param mixed $object
|
||||||
|
* @param string $title
|
||||||
|
*/
|
||||||
|
public function setI18N(&$object, $title)
|
||||||
|
{
|
||||||
|
|
||||||
|
$localeList = array('fr_FR', 'en_US', 'es_ES', 'it_IT');
|
||||||
|
|
||||||
|
foreach ($localeList as $locale) {
|
||||||
|
$object->setLocale($locale);
|
||||||
|
$object->setTitle($locale . ' : ' . $title);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Thelia\Model\Folder
|
* @return \Thelia\Model\Folder
|
||||||
|
|||||||
Reference in New Issue
Block a user