Drupal 8  8.0.2
AggregatorTestBase Class Reference
Inheritance diagram for AggregatorTestBase:

Public Member Functions

 createFeed ($feed_url=NULL, array $edit=array())
 
 deleteFeed (FeedInterface $feed)
 
 getFeedEditArray ($feed_url=NULL, array $edit=array())
 
 getFeedEditObject ($feed_url=NULL, array $values=array())
 
 getDefaultFeedItemCount ()
 
 updateFeedItems (FeedInterface $feed, $expected_count=NULL)
 
 deleteFeedItems (FeedInterface $feed)
 
 updateAndDelete (FeedInterface $feed, $expected_count)
 
 uniqueFeed ($feed_name, $feed_url)
 
 getValidOpml (array $feeds)
 
 getInvalidOpml ()
 
 getEmptyOpml ()
 
 getRSS091Sample ()
 
 getAtomSample ()
 
 getHtmlEntitiesSample ()
 
 createSampleNodes ($count=5)
 
 enableTestPlugins ()
 
- Public Member Functions inherited from WebTestBase
 __construct ($test_id=NULL)
 
 drupalGetNodeByTitle ($title, $reset=FALSE)
 
- Public Member Functions inherited from TestBase
 __construct ($test_id=NULL)
 
 run (array $methods=array())
 
 errorHandler ($severity, $message, $file=NULL, $line=NULL)
 
 configImporter ()
 
 copyConfig (StorageInterface $source_storage, StorageInterface $target_storage)
 
 getDatabasePrefix ()
 
 getTempFilesDirectory ()
 

Static Public Attributes

static $modules = ['block', 'node', 'aggregator', 'aggregator_test', 'views']
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from WebTestBase
 drupalCreateNode (array $settings=array())
 
 drupalCreateContentType (array $values=array())
 
 drupalBuildEntityView (EntityInterface $entity, $view_mode= 'full', $langcode=NULL, $reset=FALSE)
 
 drupalPlaceBlock ($plugin_id, array $settings=array())
 
 assertBlockAppears (Block $block)
 
 assertNoBlockAppears (Block $block)
 
 findBlockInstance (Block $block)
 
 drupalGetTestFiles ($type, $size=NULL)
 
 drupalCompareFiles ($file1, $file2)
 
 drupalLogin (AccountInterface $account)
 
 drupalUserIsLoggedIn ($account)
 
 drupalLogout ()
 
 setUp ()
 
 doInstall ()
 
 prepareSettings ()
 
 initSettings ()
 
 initConfig (ContainerInterface $container)
 
 rebuildAll ()
 
 installParameters ()
 
 setBatch ()
 
 restoreBatch ()
 
 initUserSession ()
 
 initKernel (Request $request)
 
 addCustomTranslations ($langcode, array $values)
 
 writeCustomTranslations ()
 
 rebuildContainer ()
 
 resetAll ()
 
 refreshVariables ()
 
 tearDown ()
 
 curlInitialize ()
 
 curlExec ($curl_options, $redirect=FALSE)
 
 curlHeaderCallback ($curlHandler, $header)
 
 curlClose ()
 
 isInChildSite ()
 
 drupalGet ($path, array $options=array(), array $headers=array())
 
 drupalGetJSON ($path, array $options=array(), array $headers=array())
 
 drupalGetWithFormat ($path, $format, array $options=[], array $headers=[])
 
 drupalGetAjax ($path, array $options=array(), array $headers=array())
 
 drupalGetXHR ($path, array $options=array(), array $headers=array())
 
 drupalPostForm ($path, $edit, $submit, array $options=array(), array $headers=array(), $form_html_id=NULL, $extra_post=NULL)
 
 drupalPostAjaxForm ($path, $edit, $triggering_element, $ajax_path=NULL, array $options=array(), array $headers=array(), $form_html_id=NULL, $ajax_settings=NULL)
 
 drupalProcessAjaxResponse ($content, array $ajax_response, array $ajax_settings, array $drupal_settings)
 
 drupalPost ($path, $accept, array $post, $options=array())
 
 drupalPostWithFormat ($path, $format, array $post, $options=[])
 
 getAjaxPageStatePostData ()
 
 serializePostValues ($post=array())
 
 translatePostValues (array $values)
 
 cronRun ()
 
 checkForMetaRefresh ()
 
 drupalHead ($path, array $options=array(), array $headers=array())
 
 handleForm (&$post, &$edit, &$upload, $submit, $form)
 
 clickLink ($label, $index=0)
 
 clickLinkPartialName ($label, $index=0)
 
 clickLinkHelper ($label, $index, $pattern)
 
 getAbsoluteUrl ($path)
 
 drupalGetHeaders ($all_requests=FALSE)
 
 drupalGetHeader ($name, $all_requests=FALSE)
 
 assertHeader ($header, $value, $message= '', $group= 'Browser')
 
 drupalGetMails ($filter=array())
 
 assertUrl ($path, array $options=array(), $message= '', $group= 'Other')
 
 assertResponse ($code, $message= '', $group= 'Browser')
 
 assertNoResponse ($code, $message= '', $group= 'Browser')
 
 assertMail ($name, $value= '', $message= '', $group= 'Email')
 
 assertMailString ($field_name, $string, $email_depth, $message= '', $group= 'Other')
 
 assertMailPattern ($field_name, $regex, $message= '', $group= 'Other')
 
 verboseEmail ($count=1)
 
 prepareRequestForGenerator ($clean_urls=TRUE, $override_server_vars=array())
 
 buildUrl ($path, array $options=array())
 
 assertCacheContext ($expected_cache_context)
 
 assertNoCacheContext ($not_expected_cache_context)
 
 assertCacheTag ($expected_cache_tag)
 
 assertNoCacheTag ($cache_tag)
 
 setHttpResponseDebugCacheabilityHeaders ($value=TRUE)
 
- Protected Member Functions inherited from TestBase
 setUp ()
 
 checkRequirements ()
 
 storeAssertion (array $assertion)
 
 assert ($status, $message= '', $group= 'Other', array $caller=NULL)
 
 getAssertionCall ()
 
 assertTrue ($value, $message= '', $group= 'Other')
 
 assertFalse ($value, $message= '', $group= 'Other')
 
 assertNull ($value, $message= '', $group= 'Other')
 
 assertNotNull ($value, $message= '', $group= 'Other')
 
 assertEqual ($first, $second, $message= '', $group= 'Other')
 
 assertNotEqual ($first, $second, $message= '', $group= 'Other')
 
 assertIdentical ($first, $second, $message= '', $group= 'Other')
 
 assertNotIdentical ($first, $second, $message= '', $group= 'Other')
 
 assertIdenticalObject ($object1, $object2, $message= '', $group= 'Other')
 
 assertNoErrorsLogged ()
 
 assertErrorLogged ($error_message)
 
 pass ($message=NULL, $group= 'Other')
 
 fail ($message=NULL, $group= 'Other')
 
 error ($message= '', $group= 'Other', array $caller=NULL)
 
 verbose ($message)
 
 beforePrepareEnvironment ()
 
 tearDown ()
 
 exceptionHandler ($exception)
 
 settingsSet ($name, $value)
 
 config ($name)
 
 getConfigSchemaExclusions ()
 

Protected Attributes

 $adminUser
 
- Protected Attributes inherited from WebTestBase
 $profile = 'testing'
 
 $url
 
 $curlHandle
 
 $assertAjaxHeader = TRUE
 
 $headers
 
 $cookies = array()
 
 $dumpHeaders = FALSE
 
 $loggedInUser = FALSE
 
 $rootUser
 
 $cookieFile = NULL
 
 $additionalCurlOptions = array()
 
 $originalBatch
 
 $originalUser = NULL
 
 $originalShutdownCallbacks = array()
 
 $sessionId = NULL
 
 $generatedTestFiles = FALSE
 
 $maximumRedirects = 5
 
 $redirectCount
 
 $maximumMetaRefreshCount = NULL
 
 $metaRefreshCount = 0
 
 $kernel
 
 $configDirectories = array()
 
 $curlCookies = array()
 
 $customTranslations
 
 $classLoader
 
- Protected Attributes inherited from TestBase
 $testId
 
 $siteDirectory = NULL
 
 $databasePrefix = NULL
 
 $timeLimit = 500
 
 $assertions = array()
 
 $skipClasses = array(__CLASS__ => TRUE)
 
 $verboseId = 0
 
 $verboseClassName
 
 $verboseDirectory
 
 $verboseDirectoryUrl
 
 $originalConf
 
 $originalConfig
 
 $originalConfigDirectories
 
 $originalContainer
 
 $originalFileDirectory = NULL
 
 $originalLanguage
 
 $originalPrefix
 
 $originalProfile
 
 $originalSessionName
 
 $originalSettings
 
 $originalShutdownCallbacks
 
 $originalSite
 
 $originalUser
 
 $publicFilesDirectory
 
 $privateFilesDirectory
 
 $tempFilesDirectory
 
 $translationFilesDirectory
 
 $kernel
 
 $container
 
 $configImporter
 
 $strictConfigSchema = TRUE
 
 $httpAuthMethod = CURLAUTH_BASIC
 
 $httpAuthCredentials = NULL
 

Additional Inherited Members

- Static Public Member Functions inherited from TestBase
static insertAssert ($test_id, $test_class, $status, $message= '', $group= 'Other', array $caller=array())
 
static deleteAssert ($message_id)
 
static getDatabaseConnection ()
 
static generatePermutations ($parameters)
 
static filePreDeleteCallback ($path)
 
- Data Fields inherited from WebTestBase
createRole as drupalCreateRole
 
createAdminRole as drupalCreateAdminRole
 
- Data Fields inherited from TestBase
 $results
 
 $verbose
 
 $dieOnFail = FALSE
 
- Static Protected Attributes inherited from TestBase
static $configSchemaCheckerExclusions
 

Detailed Description

Defines a base class for testing the Aggregator module.

Member Function Documentation

createFeed (   $feed_url = NULL,
array  $edit = array() 
)

Creates an aggregator feed.

This method simulates the form submission on path aggregator/sources/add.

Parameters
string$feed_url(optional) If given, feed will be created with this URL, otherwise /rss.xml will be used. Defaults to NULL.
array$editArray with additional form fields.
Returns
Full feed object if possible.
See Also
getFeedEditArray()

References TestBase\assertTrue(), db_query(), WebTestBase\drupalPostForm(), format_string(), AggregatorTestBase\getFeedEditArray(), Entity\load(), and t().

Referenced by AddFeedTest\testAddFeed(), AddFeedTest\testAddLongFeed(), FeedParserTest\testAtomSample(), AggregatorRenderingTest\testBlockLinks(), AggregatorCronTest\testCron(), FeedProcessorPluginTest\testDelete(), DeleteFeedTest\testDeleteFeed(), DeleteFeedItemTest\testDeleteFeedItem(), AddFeedTest\testFeedLabelEscaping(), AggregatorRenderingTest\testFeedPage(), FeedAdminDisplayTest\testFeedUpdateFields(), FeedFetcherPluginTest\testfetch(), FeedParserTest\testHtmlEntitiesSample(), AggregatorAdminTest\testOverviewPage(), FeedProcessorPluginTest\testPostProcess(), FeedProcessorPluginTest\testProcess(), FeedParserTest\testRSS091Sample(), UpdateFeedTest\testUpdateFeed(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

createSampleNodes (   $count = 5)

Creates sample article nodes.

Parameters
int$count(optional) The number of nodes to generate. Defaults to five.

References WebTestBase\drupalPostForm(), and t().

Referenced by FeedFetcherPluginTest\setUp(), FeedProcessorPluginTest\setUp(), AggregatorRenderingTest\testBlockLinks(), AggregatorCronTest\testCron(), AggregatorRenderingTest\testFeedPage(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteFeed ( FeedInterface  $feed)

Deletes an aggregator feed.

Parameters
\Drupal\aggregator\FeedInterface$feedFeed object representing the feed.

References WebTestBase\drupalPostForm(), EntityInterface\id(), EntityInterface\label(), and t().

Referenced by AddFeedTest\testAddFeed(), AddFeedTest\testAddLongFeed(), DeleteFeedTest\testDeleteFeed(), DeleteFeedItemTest\testDeleteFeedItem(), FeedAdminDisplayTest\testFeedUpdateFields(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

deleteFeedItems ( FeedInterface  $feed)

Confirms an item removal from a feed.

Parameters
\Drupal\aggregator\FeedInterface$feedFeed object representing the feed.

References WebTestBase\drupalPostForm(), EntityInterface\id(), EntityInterface\label(), and t().

Referenced by AggregatorCronTest\testCron(), FeedFetcherPluginTest\testfetch(), UpdateFeedItemTest\testUpdateFeedItem(), and AggregatorTestBase\updateAndDelete().

Here is the call graph for this function:

Here is the caller graph for this function:

enableTestPlugins ( )

Enable the plugins coming with aggregator_test module.

References TestBase\config().

Referenced by FeedFetcherPluginTest\setUp(), FeedProcessorPluginTest\setUp(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

getAtomSample ( )

Returns a example Atom feed.

Returns
string Path to the feed.

Referenced by FeedParserTest\testAtomSample().

Here is the caller graph for this function:

getDefaultFeedItemCount ( )

Returns the count of the randomly created feed array.

Returns
int Number of feed items on default feed created by createFeed().

References TestBase\config(), and db_query_range().

Referenced by AggregatorRenderingTest\testBlockLinks(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

getEmptyOpml ( )

Creates a valid but empty OPML file.

Returns
string Path to empty OPML file.

References file_unmanaged_save_data(), and Drupal\url().

Referenced by ImportOpmlTest\submitImportForm(), and ImportOpmlTest\validateImportFormFields().

Here is the call graph for this function:

Here is the caller graph for this function:

getFeedEditArray (   $feed_url = NULL,
array  $edit = array() 
)

Returns a randomly generated feed edit array.

Parameters
string$feed_url(optional) If given, feed will be created with this URL, otherwise /rss.xml will be used. Defaults to NULL.
array$editArray with additional form fields.
Returns
array A feed array.

References Drupal\url().

Referenced by AggregatorTestBase\createFeed(), ImportOpmlTest\submitImportForm(), and UpdateFeedTest\testUpdateFeed().

Here is the call graph for this function:

Here is the caller graph for this function:

getFeedEditObject (   $feed_url = NULL,
array  $values = array() 
)

Returns a randomly generated feed edit object.

Parameters
string$feed_url(optional) If given, feed will be created with this URL, otherwise /rss.xml will be used. Defaults to NULL.
array$values(optional) Default values to initialize object properties with.
Returns
A feed object.

References Drupal\url().

Here is the call graph for this function:

getHtmlEntitiesSample ( )

Returns a example feed.

Returns
string Path to the feed.

Referenced by FeedParserTest\testHtmlEntitiesSample().

Here is the caller graph for this function:

getInvalidOpml ( )

Creates an invalid OPML file.

Returns
string Path to invalid OPML file.

References file_unmanaged_save_data().

Referenced by ImportOpmlTest\submitImportForm().

Here is the call graph for this function:

Here is the caller graph for this function:

getRSS091Sample ( )

Returns a example RSS091 feed.

Returns
string Path to the feed.

Referenced by AggregatorAdminTest\testOverviewPage(), FeedParserTest\testRSS091Sample(), and UpdateFeedItemTest\testUpdateFeedItem().

Here is the caller graph for this function:

getValidOpml ( array  $feeds)

Creates a valid OPML file from an array of feeds.

Parameters
array$feedsAn array of feeds.
Returns
string Path to valid OPML file.

Does not have an XML declaration, must pass the parser.

References Html\escape(), file_unmanaged_save_data(), and Drupal\url().

Referenced by ImportOpmlTest\submitImportForm().

Here is the call graph for this function:

Here is the caller graph for this function:

setUp ( )
protected

{}

References WebTestBase\drupalCreateContentType(), WebTestBase\drupalLogin(), and WebTestBase\drupalPlaceBlock().

Here is the call graph for this function:

uniqueFeed (   $feed_name,
  $feed_url 
)

Checks whether the feed name and URL are unique.

Parameters
string$feed_nameString containing the feed name to check.
string$feed_urlString containing the feed url to check.
Returns
bool TRUE if feed is unique.

References db_query().

Referenced by AddFeedTest\testAddFeed(), and AddFeedTest\testAddLongFeed().

Here is the call graph for this function:

Here is the caller graph for this function:

updateAndDelete ( FeedInterface  $feed,
  $expected_count 
)

Adds and deletes feed items and ensure that the count is zero.

Parameters
\Drupal\aggregator\FeedInterface$feedFeed object representing the feed.
int$expected_countExpected number of feed items.

References TestBase\assertTrue(), db_query(), AggregatorTestBase\deleteFeedItems(), EntityInterface\id(), and AggregatorTestBase\updateFeedItems().

Referenced by FeedProcessorPluginTest\testDelete(), and DeleteFeedItemTest\testDeleteFeedItem().

Here is the call graph for this function:

Here is the caller graph for this function:

updateFeedItems ( FeedInterface  $feed,
  $expected_count = NULL 
)

Updates the feed items.

This method simulates a click to admin/config/services/aggregator/update/$fid.

Parameters
\Drupal\aggregator\FeedInterface$feedFeed object representing the feed.
int | null$expected_countExpected number of feed items. If omitted no check will happen.

References TestBase\assertEqual(), WebTestBase\assertResponse(), WebTestBase\clickLink(), db_query(), WebTestBase\drupalGet(), format_string(), FeedInterface\getUrl(), and EntityInterface\id().

Referenced by AggregatorRenderingTest\testBlockLinks(), AggregatorRenderingTest\testFeedPage(), FeedAdminDisplayTest\testFeedUpdateFields(), FeedFetcherPluginTest\testfetch(), FeedProcessorPluginTest\testPostProcess(), FeedProcessorPluginTest\testProcess(), UpdateFeedItemTest\testUpdateFeedItem(), and AggregatorTestBase\updateAndDelete().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: