comparison core/modules/path/tests/src/Functional/PathLanguageTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
59 'settings[node][page][fields][path]' => 1, 59 'settings[node][page][fields][path]' => 1,
60 'settings[node][page][fields][body]' => 1, 60 'settings[node][page][fields][body]' => 1,
61 'settings[node][page][settings][language][language_alterable]' => 1, 61 'settings[node][page][settings][language][language_alterable]' => 1,
62 ]; 62 ];
63 $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); 63 $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration'));
64 \Drupal::entityManager()->clearCachedDefinitions();
65 64
66 $definitions = \Drupal::entityManager()->getFieldDefinitions('node', 'page'); 65 $definitions = \Drupal::entityManager()->getFieldDefinitions('node', 'page');
67 $this->assertTrue($definitions['path']->isTranslatable(), 'Node path is translatable.'); 66 $this->assertTrue($definitions['path']->isTranslatable(), 'Node path is translatable.');
68 $this->assertTrue($definitions['body']->isTranslatable(), 'Node body is translatable.'); 67 $this->assertTrue($definitions['body']->isTranslatable(), 'Node body is translatable.');
69 } 68 }
116 115
117 // Confirm that the alias is returned for the URL. Languages are cached on 116 // Confirm that the alias is returned for the URL. Languages are cached on
118 // many levels, and we need to clear those caches. 117 // many levels, and we need to clear those caches.
119 $this->container->get('language_manager')->reset(); 118 $this->container->get('language_manager')->reset();
120 $languages = $this->container->get('language_manager')->getLanguages(); 119 $languages = $this->container->get('language_manager')->getLanguages();
121 $url = $english_node_french_translation->url('canonical', ['language' => $languages['fr']]); 120 $url = $english_node_french_translation->toUrl('canonical', ['language' => $languages['fr']])->toString();
122 121
123 $this->assertTrue(strpos($url, $edit['path[0][alias]']), 'URL contains the path alias.'); 122 $this->assertTrue(strpos($url, $edit['path[0][alias]']), 'URL contains the path alias.');
124 123
125 // Confirm that the alias works even when changing language negotiation 124 // Confirm that the alias works even when changing language negotiation
126 // options. Enable User language detection and selection over URL one. 125 // options. Enable User language detection and selection over URL one.