Loading core/modules/comment/tests/src/Functional/CommentPagerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public function assertCommentOrder(array $comments, array $expected_order) { foreach ($comment_anchors as $anchor) { $result_order[] = substr($anchor->getAttribute('id'), 8); } return $this->assertEquals($expected_cids, $result_order, new FormattableMarkup('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)])); $this->assertEquals($expected_cids, $result_order, new FormattableMarkup('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)])); } /** Loading core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php +1 −4 Original line number Diff line number Diff line Loading @@ -259,16 +259,13 @@ public function testAccountLanguageSettingsUI() { * TRUE if translatability should be enabled, FALSE otherwise. * @param array $edit * An array of values to submit to the content translation settings page. * * @return bool * TRUE if the assertion succeeded, FALSE otherwise. */ protected function assertSettings($entity_type, $bundle, $enabled, $edit) { $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, 'Save configuration'); $args = ['@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled']; $message = new FormattableMarkup('Translation for entity @entity_type (@bundle) is @enabled.', $args); return $this->assertEquals($enabled, \Drupal::service('content_translation.manager')->isEnabled($entity_type, $bundle), $message); $this->assertEquals($enabled, \Drupal::service('content_translation.manager')->isEnabled($entity_type, $bundle), $message); } /** Loading core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php +2 −5 Original line number Diff line number Diff line Loading @@ -219,8 +219,6 @@ protected function uploadImage($uri) { * The expected width of the uploaded image. * @param string $height * The expected height of the uploaded image. * * @return bool */ protected function assertSavedMaxDimensions($width, $height) { $image_upload_settings = Editor::load('basic_html')->getImageUploadSettings(); Loading @@ -228,9 +226,8 @@ protected function assertSavedMaxDimensions($width, $height) { 'width' => $image_upload_settings['max_dimensions']['width'], 'height' => $image_upload_settings['max_dimensions']['height'], ]; $same_width = $this->assertEquals($expected['width'], $width, 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"'); $same_height = $this->assertEquals($expected['height'], $height, 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"'); return $same_width && $same_height; $this->assertEquals($expected['width'], $width, 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"'); $this->assertEquals($expected['height'], $height, 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"'); } } core/tests/Drupal/KernelTests/AssertContentTrait.php +4 −5 Original line number Diff line number Diff line Loading @@ -802,9 +802,6 @@ protected function assertTextPattern($pattern, $message = NULL, $group = 'Other' * in test output. Use 'Debug' to indicate this is debugging output. Do not * translate this string. Defaults to 'Other'; most tests do not override * this default. * * @return bool * TRUE on pass, FALSE on fail. */ protected function assertTitle($title, $message = '', $group = 'Other') { // Don't use xpath as it messes with HTML escaping. Loading @@ -817,9 +814,11 @@ protected function assertTitle($title, $message = '', $group = 'Other') { '@expected' => var_export($title, TRUE), ]); } return $this->assertEquals($title, $actual, $message); $this->assertEquals($title, $actual, $message); } else { $this->fail('No title element found on the page.'); } return $this->fail('No title element found on the page.'); } /** Loading core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php +2 −8 Original line number Diff line number Diff line Loading @@ -333,9 +333,6 @@ public function testAutocreateApi() { * The referencing entity. * @param $setter_callback * A callback setting the target entity on the referencing entity. * * @return bool * TRUE if the user was autocreated, FALSE otherwise. */ protected function assertUserAutocreate(EntityInterface $entity, $setter_callback) { $storage = $this->entityTypeManager->getStorage('user'); Loading @@ -345,7 +342,7 @@ protected function assertUserAutocreate(EntityInterface $entity, $setter_callbac $entity->save(); $storage->resetCache(); $user = User::load($user_id); return $this->assertEquals($entity->user_id->target_id, $user->id()); $this->assertEquals($entity->user_id->target_id, $user->id()); } /** Loading @@ -355,9 +352,6 @@ protected function assertUserAutocreate(EntityInterface $entity, $setter_callbac * The referencing entity. * @param $setter_callback * A callback setting the target entity on the referencing entity. * * @return bool * TRUE if the user was autocreated, FALSE otherwise. */ protected function assertUserRoleAutocreate(EntityInterface $entity, $setter_callback) { $storage = $this->entityTypeManager->getStorage('user_role'); Loading @@ -367,7 +361,7 @@ protected function assertUserRoleAutocreate(EntityInterface $entity, $setter_cal $entity->save(); $storage->resetCache(); $role = Role::load($role_id); return $this->assertEquals($entity->user_role->target_id, $role->id()); $this->assertEquals($entity->user_role->target_id, $role->id()); } /** Loading Loading
core/modules/comment/tests/src/Functional/CommentPagerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public function assertCommentOrder(array $comments, array $expected_order) { foreach ($comment_anchors as $anchor) { $result_order[] = substr($anchor->getAttribute('id'), 8); } return $this->assertEquals($expected_cids, $result_order, new FormattableMarkup('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)])); $this->assertEquals($expected_cids, $result_order, new FormattableMarkup('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)])); } /** Loading
core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php +1 −4 Original line number Diff line number Diff line Loading @@ -259,16 +259,13 @@ public function testAccountLanguageSettingsUI() { * TRUE if translatability should be enabled, FALSE otherwise. * @param array $edit * An array of values to submit to the content translation settings page. * * @return bool * TRUE if the assertion succeeded, FALSE otherwise. */ protected function assertSettings($entity_type, $bundle, $enabled, $edit) { $this->drupalGet('admin/config/regional/content-language'); $this->submitForm($edit, 'Save configuration'); $args = ['@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled']; $message = new FormattableMarkup('Translation for entity @entity_type (@bundle) is @enabled.', $args); return $this->assertEquals($enabled, \Drupal::service('content_translation.manager')->isEnabled($entity_type, $bundle), $message); $this->assertEquals($enabled, \Drupal::service('content_translation.manager')->isEnabled($entity_type, $bundle), $message); } /** Loading
core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php +2 −5 Original line number Diff line number Diff line Loading @@ -219,8 +219,6 @@ protected function uploadImage($uri) { * The expected width of the uploaded image. * @param string $height * The expected height of the uploaded image. * * @return bool */ protected function assertSavedMaxDimensions($width, $height) { $image_upload_settings = Editor::load('basic_html')->getImageUploadSettings(); Loading @@ -228,9 +226,8 @@ protected function assertSavedMaxDimensions($width, $height) { 'width' => $image_upload_settings['max_dimensions']['width'], 'height' => $image_upload_settings['max_dimensions']['height'], ]; $same_width = $this->assertEquals($expected['width'], $width, 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"'); $same_height = $this->assertEquals($expected['height'], $height, 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"'); return $same_width && $same_height; $this->assertEquals($expected['width'], $width, 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"'); $this->assertEquals($expected['height'], $height, 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"'); } }
core/tests/Drupal/KernelTests/AssertContentTrait.php +4 −5 Original line number Diff line number Diff line Loading @@ -802,9 +802,6 @@ protected function assertTextPattern($pattern, $message = NULL, $group = 'Other' * in test output. Use 'Debug' to indicate this is debugging output. Do not * translate this string. Defaults to 'Other'; most tests do not override * this default. * * @return bool * TRUE on pass, FALSE on fail. */ protected function assertTitle($title, $message = '', $group = 'Other') { // Don't use xpath as it messes with HTML escaping. Loading @@ -817,9 +814,11 @@ protected function assertTitle($title, $message = '', $group = 'Other') { '@expected' => var_export($title, TRUE), ]); } return $this->assertEquals($title, $actual, $message); $this->assertEquals($title, $actual, $message); } else { $this->fail('No title element found on the page.'); } return $this->fail('No title element found on the page.'); } /** Loading
core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php +2 −8 Original line number Diff line number Diff line Loading @@ -333,9 +333,6 @@ public function testAutocreateApi() { * The referencing entity. * @param $setter_callback * A callback setting the target entity on the referencing entity. * * @return bool * TRUE if the user was autocreated, FALSE otherwise. */ protected function assertUserAutocreate(EntityInterface $entity, $setter_callback) { $storage = $this->entityTypeManager->getStorage('user'); Loading @@ -345,7 +342,7 @@ protected function assertUserAutocreate(EntityInterface $entity, $setter_callbac $entity->save(); $storage->resetCache(); $user = User::load($user_id); return $this->assertEquals($entity->user_id->target_id, $user->id()); $this->assertEquals($entity->user_id->target_id, $user->id()); } /** Loading @@ -355,9 +352,6 @@ protected function assertUserAutocreate(EntityInterface $entity, $setter_callbac * The referencing entity. * @param $setter_callback * A callback setting the target entity on the referencing entity. * * @return bool * TRUE if the user was autocreated, FALSE otherwise. */ protected function assertUserRoleAutocreate(EntityInterface $entity, $setter_callback) { $storage = $this->entityTypeManager->getStorage('user_role'); Loading @@ -367,7 +361,7 @@ protected function assertUserRoleAutocreate(EntityInterface $entity, $setter_cal $entity->save(); $storage->resetCache(); $role = Role::load($role_id); return $this->assertEquals($entity->user_role->target_id, $role->id()); $this->assertEquals($entity->user_role->target_id, $role->id()); } /** Loading