$result=$connection->query('SELECT * FROM {url_alias} WHERE source = :source AND alias= :alias AND langcode = :langcode',array(':source'=>$alias['source'],':alias'=>$alias['alias'],':langcode'=>$alias['langcode']));
$result=$connection->query('SELECT pid FROM {url_alias} WHERE source = :source AND alias= :alias AND langcode = :langcode',array(':source'=>$alias['source'],':alias'=>$alias['alias'].'_updated',':langcode'=>$alias['langcode']));
$pid=$result->fetchField();
...
...
@@ -69,7 +69,7 @@ function testCRUD() {
//Delete a few aliases
foreach($aliasesas$alias){
$pid=$alias['pid'];
$path->delete(array('pid'=>$pid));
$aliasStorage->delete(array('pid'=>$pid));
$result=$connection->query('SELECT * FROM {url_alias} WHERE pid = :pid',array(':pid'=>$pid));
$this->assertEqual($aliasManager->getPathAlias($path['source']),"users/Dries",'English alias still returned after entering a language-neutral alias.');
// Create a language-specific (xx-lolspeak) alias for the same path.
$this->assertEqual($aliasManager->getPathAlias($path['source']),"users/Dries",'English alias still returned after entering a LOLspeak alias.');
// The LOLspeak alias should be returned if we really want LOLspeak.
$this->assertEqual($aliasManager->getPathAlias($path['source'],'xx-lolspeak'),'LOL','LOLspeak alias returned if we specify xx-lolspeak to the alias manager.');
// Hook that clears cache is not executed with unit tests.
$aliasManager->cacheClear();
$this->assertEqual($aliasManager->getPathAlias($path['source']),$path['alias'],'Recently created English alias returned.');
...
...
@@ -144,14 +144,14 @@ function testLookupPath() {
// Remove the English aliases, which should cause a fallback to the most
// recently created language-neutral alias, 'bar'.
$pathObject->delete(array('langcode'=>'en'));
$aliasStorage->delete(array('langcode'=>'en'));
// Hook that clears cache is not executed with unit tests.
$aliasManager->cacheClear();
$this->assertEqual($aliasManager->getPathAlias($path['source']),'bar','Path lookup falls back to recently created language-neutral alias.');
// Test the situation where the alias and language are the same, but
// the source differs. The newer alias record should be returned.
$pathObject->save('user/2','bar');
$aliasStorage->save('user/2','bar');
// Hook that clears cache is not executed with unit tests.
$aliasManager->cacheClear();
$this->assertEqual($aliasManager->getSystemPath('bar'),'user/2','Newer alias record is returned when comparing two Language::LANGCODE_NOT_SPECIFIED paths with the same alias.');