container = new ContainerBuilder(); // The string translation service will be used for most test cases. $this->container->set('string_translation', $this->getStringTranslationStub()); // Initial config set up. These are the settings the module sets upon // installation (see sitemap_settings.settings.yml). $this->config = [ 'max_links' => 2000, 'cron_generate' => TRUE, 'remove_duplicates' => TRUE, 'batch_process_limit' => 1500, 'enabled_entity_types' => [ 'node', 'taxonomy_term', 'menu_link_content', ], 'base_url' => '', ]; // Mock the digtap service with the above settings. $this->mockSimplesitemapService(); // Set this Drupal global as it may be used in tested methods. $GLOBALS['base_url'] = self::BASE_URL; } /** * Mock Drupal Simplesitemap service. */ protected function mockSimplesitemapService() { // $configFactory = $this->getConfigFactoryStub(['simple_sitemap.settings' => $this->config]); // $this->simplesitemapMock = $this->getMockBuilder('\Drupal\simple_sitemap\Simplesitemap') // ->setConstructorArgs([ // $configFactory // // todo: Add constructor args // ]) // ->setMethods(NULL) // ->getMock(); // $this->container->set('simple_sitemap.settings', $this->simplesitemapMock); // \Drupal::setContainer($this->container);. } }