Search Results
Article: Drupal Testing Strategies
… within your module. By default, the functional tests will run through curl requests, and so won't understand JavaScript elements on the page. … want to plug into the system. This means that you can support simple curl based tests or spin up a browser and use Chrome to test the site. …
… $url = $style->buildUri($file->getFileUri()); $this->fileSystem->unlink($url); } else { // Add the image we created to a media item. $imageMedia …
… ?: $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(); // Split the language into parts. $languageParts = … ?: $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(); } if (isset($this->noPath[$langcode][$alias])) { // Path … $this->languageManager() ->getCurrentLanguage(LanguageInterface::TYPE_URL) ->getId(); // If the language of the translated item: // - Does …
… if statement will mean that the authentication triggers if the site URL is staging.example.com. if (php_sapi_name() != 'cli' && …
Performing behavioural testing on a Drupal project allows you to make sure that all of your features work as they should do. This is especially important when you update code as this can introduce bugs that are otherwise time consuming or difficult to spot. One aspect that is important to …
… site you can use the following SQL. This assumes that you have the DBLog module active on the site, which might not always be the case. The …
… would. The neat thing about this is that once you have generated the URL your browser will open automatically and take you to the link. …
… on what is in the recommended composer file see my previous blog post on the subject . After this step you can require any other …
… x Unsafe usage of new static(). 💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static ------ …
… over and each one is placed into the sitemap.xml file as an absolute URL. We do this by adding each link to the $arbitrary_links array that … by the Simple XML Sitemap module as a new link. <?php use Drupal\Core\Url; /** * Implements hook_simple_sitemap_arbitrary_links_alter(). */ … 'TRUE') { // This is a public link, so add to the sitemap.xml file. $url = Url::fromRoute($routeName, [], ['absolute' => TRUE, 'https' => …