Commit 0de8bea7 authored by catch's avatar catch

Issue #2067007 by andypost: Replace \Drupal:: with ->container->get() in test...

Issue #2067007 by andypost: Replace \Drupal:: with ->container->get() in test classes of aggregator module.
parent 523fb855
......@@ -24,8 +24,6 @@ public static function getInfo() {
*/
public function testCron() {
// Create feed and test basic updating on cron.
global $base_url;
$key = \Drupal::state()->get('system.cron_key');
$this->createSampleNodes();
$feed = $this->createFeed();
$this->cronRun();
......
......@@ -137,7 +137,7 @@ function getFeedEditObject($feed_url = NULL, array $values = array()) {
*/
function getDefaultFeedItemCount() {
// Our tests are based off of rss.xml, so let's find out how many elements should be related.
$feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, \Drupal::config('system.rss')->get('items.limit'))->fetchField();
$feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, $this->container->get('config.factory')->get('system.rss')->get('items.limit'))->fetchField();
return $feed_count > 10 ? 10 : $feed_count;
}
......@@ -370,7 +370,7 @@ function createSampleNodes($count = 5) {
* Enable the plugins coming with aggregator_test module.
*/
function enableTestPlugins() {
\Drupal::config('aggregator.settings')
$this->container->get('config.factory')->get('aggregator.settings')
->set('fetcher', 'aggregator_test_fetcher')
->set('parser', 'aggregator_test_parser')
->set('processors', array(
......
......@@ -26,7 +26,7 @@ function setUp() {
// Do not remove old aggregator items during these tests, since our sample
// feeds have hardcoded dates in them (which may be expired when this test
// is run).
\Drupal::config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
$this->container->get('config.factory')->get('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
// Reset any reader cache between tests.
Reader::reset();
// Set our bridge extension manager to Zend Feed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment