Drupal 8  8.0.2
ManageFieldsTest Class Reference
Inheritance diagram for ManageFieldsTest:

Public Member Functions

 testCRUDFields ()
 
 manageFieldsPage ($type= '')
 
 createField ()
 
 updateField ()
 
 addExistingField ()
 
 cardinalitySettings ()
 
 assertFieldSettings ($bundle, $field_name, $string= 'dummy test string', $entity_type= 'node')
 
 testFieldPrefix ()
 
 testDefaultValue ()
 
 testDeleteField ()
 
 testDisallowedFieldNames ()
 
 testLockedField ()
 
 testHiddenFields ()
 
 testDuplicateFieldName ()
 
 testExternalDestinations ()
 
 testDeleteTaxonomyField ()
 
 testHelpDescriptions ()
 
 fieldListAdminPage ()
 
 testPreconfiguredFields ()
 
 testNonExistentFieldUrls ()
 
- 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 = array('node', 'field_ui', 'field_test', 'taxonomy', 'image', 'block')
 

Protected Member Functions

 setUp ()
 
 deleteField ()
 
 addPersistentFieldStorage ()
 
- 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

 $contentType
 
 $fieldLabel
 
 $fieldNameInput
 
 $fieldName
 
- 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

Tests the Field UI "Manage fields" screen.

field_ui

Member Function Documentation

addExistingField ( )

Tests adding an existing field in another content type.

References TestBase\assertFalse(), TestBase\assertTrue(), WebTestBase\drupalGet(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

addPersistentFieldStorage ( )
protected

Tests that persistent field storage appears in the field UI.

References WebTestBase\clickLink(), WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), FieldStorageConfig\loadByName(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

assertFieldSettings (   $bundle,
  $field_name,
  $string = 'dummy test string',
  $entity_type = 'node' 
)

Asserts field settings are as expected.

Parameters
$bundleThe bundle name for the field.
$field_nameThe field name for the field.
$stringThe settings text.
$entity_typeThe entity type for the field.

References TestBase\assertTrue(), FieldConfig\loadByName(), and FieldStorageConfig\loadByName().

Referenced by ManageFieldsTest\updateField().

Here is the call graph for this function:

Here is the caller graph for this function:

cardinalitySettings ( )

Tests the cardinality settings of a field.

We do not test if the number can be submitted with anything else than a numeric value. That is tested already in FormTest::testNumber().

References FieldStorageDefinitionInterface\CARDINALITY_UNLIMITED, WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

createField ( )

Tests adding a new field.

Todo:
Assert properties can bet set in the form and read back in $field_storage and $fields.

Referenced by ManageFieldsTest\testCRUDFields().

Here is the caller graph for this function:

deleteField ( )
protected

Tests deleting a field from the field edit form.

References WebTestBase\assertResponse(), WebTestBase\clickLink(), WebTestBase\drupalGet(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

fieldListAdminPage ( )

Tests that the field list administration page operates correctly.

References TestBase\assertTrue(), and WebTestBase\drupalGet().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

manageFieldsPage (   $type = '')

Tests the manage fields page.

Parameters
string$type(optional) The name of a content type.

References TestBase\assertEqual(), TestBase\assertIdentical(), WebTestBase\drupalGet(), format_string(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

Here is the call graph for this function:

Here is the caller graph for this function:

setUp ( )
protected

{}

References Entity\create(), WebTestBase\drupalCreateContentType(), WebTestBase\drupalLogin(), WebTestBase\drupalPlaceBlock(), and LanguageInterface\LANGCODE_NOT_SPECIFIED.

Here is the call graph for this function:

testCRUDFields ( )

Runs the field CRUD tests.

In order to act on the same fields, and not create the fields over and over again the following tests create, update and delete the same fields.

References ManageFieldsTest\addExistingField(), ManageFieldsTest\addPersistentFieldStorage(), ManageFieldsTest\cardinalitySettings(), ManageFieldsTest\createField(), ManageFieldsTest\deleteField(), ManageFieldsTest\fieldListAdminPage(), ManageFieldsTest\manageFieldsPage(), and ManageFieldsTest\updateField().

Here is the call graph for this function:

testDefaultValue ( )

Tests that default value is correctly validated and saved.

References TestBase\assertEqual(), FieldStorageDefinitionInterface\CARDINALITY_UNLIMITED, Entity\create(), WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), FieldConfig\loadByName(), FieldStorageConfig\loadByName(), and t().

Here is the call graph for this function:

testDeleteField ( )

Tests that deletion removes field storages and fields as expected.

References TestBase\assertNotNull(), TestBase\assertNull(), WebTestBase\drupalCreateContentType(), FieldConfig\loadByName(), and FieldStorageConfig\loadByName().

Here is the call graph for this function:

testDeleteTaxonomyField ( )

Tests that deletion removes field storages and fields as expected for a term.

References TestBase\assertNull(), FieldConfig\loadByName(), and FieldStorageConfig\loadByName().

Here is the call graph for this function:

testDisallowedFieldNames ( )

Tests that Field UI respects disallowed field names.

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

Here is the call graph for this function:

testDuplicateFieldName ( )

Tests that a duplicate field name is caught by validation.

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

Here is the call graph for this function:

testExternalDestinations ( )

Tests that external URLs in the 'destinations' query parameter are blocked.

References WebTestBase\assertResponse(), WebTestBase\assertUrl(), and WebTestBase\drupalPostForm().

Here is the call graph for this function:

testFieldPrefix ( )

Tests that the 'field_prefix' setting works on Field UI.

References TestBase\config(), WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), format_string(), and t().

Here is the call graph for this function:

testHelpDescriptions ( )

Tests that help descriptions render valid HTML.

References Entity\create(), WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), and t().

Here is the call graph for this function:

testHiddenFields ( )

Tests that Field UI respects the 'no_ui' flag in the field type definition.

References TestBase\assertFalse(), TestBase\assertTrue(), Entity\create(), WebTestBase\drupalGet(), SafeMarkup\format(), format_string(), Entity\load(), Drupal\service(), and t().

Here is the call graph for this function:

testLockedField ( )

Tests that Field UI respects locked fields.

References TestBase\assertFalse(), WebTestBase\assertResponse(), TestBase\assertTrue(), Entity\create(), and WebTestBase\drupalGet().

Here is the call graph for this function:

testNonExistentFieldUrls ( )

Tests the access to non-existent field URLs.

References WebTestBase\assertResponse(), and WebTestBase\drupalGet().

Here is the call graph for this function:

testPreconfiguredFields ( )

Tests the "preconfigured field" functionality.

See Also

References TestBase\assertEqual(), TestBase\assertTrue(), FieldStorageDefinitionInterface\CARDINALITY_UNLIMITED, WebTestBase\drupalGet(), FieldConfig\loadByName(), and FieldStorageConfig\loadByName().

Here is the call graph for this function:

updateField ( )

Tests editing an existing field.

References ManageFieldsTest\assertFieldSettings(), WebTestBase\assertUrl(), WebTestBase\drupalGet(), WebTestBase\drupalPostForm(), and t().

Referenced by ManageFieldsTest\testCRUDFields().

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: