Commit 484d80db authored by catch's avatar catch
Browse files

Issue #3172438 by mondrake, kishor_kolekar, longwave, NitinLama, mikelutz,...

Issue #3172438 by mondrake, kishor_kolekar, longwave, NitinLama, mikelutz, jungle: Since symfony/phpunit-bridge 5.1: Using "@expectedDeprecation" annotations in tests is deprecated, use the "ExpectDeprecationTrait::expectDeprecation()" method instead
parent c79ad7c7
......@@ -19,9 +19,9 @@ class LayoutBuilderElementTest extends KernelTestBase {
/**
* @group legacy
* @expectedDeprecation The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690
*/
public function testConstructorTempStoreDeprecation() {
$this->expectDeprecation('The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690');
$layout_temp_storage = $this->prophesize(LayoutTempstoreRepositoryInterface::class);
$element = new LayoutBuilder(
[],
......@@ -34,9 +34,9 @@ public function testConstructorTempStoreDeprecation() {
/**
* @group legacy
* @expectedDeprecation Calling LayoutBuilder::__construct() with the $messenger argument is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. See https://www.drupal.org/node/3152690
*/
public function testConstructorMessengerDeprecation() {
$this->expectDeprecation('Calling LayoutBuilder::__construct() with the $messenger argument is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. See https://www.drupal.org/node/3152690');
$event_dispatcher = $this->prophesize(EventDispatcherInterface::class);
$messenger = $this->prophesize(MessengerInterface::class);
......
......@@ -47,9 +47,10 @@ protected function setUp(): void {
/**
* @covers ::defineValueProcessPipeline
* @expectedDeprecation The Drupal\migrate_drupal\Plugin\migrate\field\NodeReference is deprecated in drupal:9.1.0 and will be removed from drupal:10.0.0. Instead use \Drupal\migrate_drupal\Plugin\migrate\field\d6\NodeReference. See https://www.drupal.org/node/3159537.
* @runInSeparateProcess
*/
public function testDefineValueProcessPipeline() {
$this->expectDeprecation('The Drupal\migrate_drupal\Plugin\migrate\field\NodeReference is deprecated in drupal:9.1.0 and will be removed from drupal:10.0.0. Instead use \Drupal\migrate_drupal\Plugin\migrate\field\d6\NodeReference. See https://www.drupal.org/node/3159537.');
$this->plugin->defineValueProcessPipeline($this->migration, 'somefieldname', []);
$expected = [
......
......@@ -30,32 +30,24 @@ protected function setUp(): void {
$this->installConfig(['search']);
}
/**
* @expectedDeprecation search_index_split() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\search\SearchTextProcessorInterface::process() instead. See https://www.drupal.org/node/3078162
*/
public function testDeprecatedIndexSplit() {
$this->expectDeprecation('search_index_split() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\search\SearchTextProcessorInterface::process() instead. See https://www.drupal.org/node/3078162');
$this->assertEquals(["two", "words"], search_index_split("two words"));
}
/**
* @expectedDeprecation search_simplify() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\search\SearchTextProcessorInterface::analyze() instead. See https://www.drupal.org/node/3078162
*/
public function testDeprecatedSimplify() {
$this->expectDeprecation('search_simplify() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\search\SearchTextProcessorInterface::analyze() instead. See https://www.drupal.org/node/3078162');
// cSpell:disable-next-line
$this->assertEquals("vogel", search_simplify("Vögel"));
}
/**
* @expectedDeprecation search_expand_cjk() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use a custom implementation of SearchTextProcessorInterface instead. instead. See https://www.drupal.org/node/3078162
*/
public function testExpandCjk() {
$this->expectDeprecation('search_expand_cjk() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use a custom implementation of SearchTextProcessorInterface instead. instead. See https://www.drupal.org/node/3078162');
$this->assertEquals(" 이런 ", search_expand_cjk(["이런"]));
}
/**
* @expectedDeprecation search_invoke_preprocess() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use a custom implementation of SearchTextProcessorInterface instead. See https://www.drupal.org/node/3078162
*/
public function testInvokePreprocess() {
$this->expectDeprecation('search_invoke_preprocess() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use a custom implementation of SearchTextProcessorInterface instead. See https://www.drupal.org/node/3078162');
$text = $this->randomString();
search_invoke_preprocess($text);
$this->assertIsString($text);
......
......@@ -31,9 +31,9 @@ class CsrfRequestHeaderTest extends BrowserTestBase {
* uses the deprecated _access_rest_csrf.
*
* @group legacy
* @expectedDeprecation Route requirement _access_rest_csrf is deprecated in drupal:8.2.0 and is removed in drupal:10.0.0. Use _csrf_request_header_token instead. See https://www.drupal.org/node/2772399
*/
public function testRouteAccess() {
$this->expectDeprecation('Route requirement _access_rest_csrf is deprecated in drupal:8.2.0 and is removed in drupal:10.0.0. Use _csrf_request_header_token instead. See https://www.drupal.org/node/2772399');
$client = $this->getHttpClient();
$csrf_token_paths = ['deprecated/session/token', 'session/token'];
// Test using the both the current path and a test path that returns
......
......@@ -29,10 +29,9 @@ protected function setUp(): void {
* Tests the stylesheets-remove key.
*
* @throws \Behat\Mink\Exception\ExpectationException
*
* @expectedDeprecation The theme info key stylesheets-remove implemented by theme test_legacy_stylesheets_remove is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/2497313
*/
public function testStyleSheetsRemove() {
$this->expectDeprecation('The theme info key stylesheets-remove implemented by theme test_legacy_stylesheets_remove is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/2497313');
\Drupal::configFactory()->getEditable('system.theme')->set('default', 'classy')->save();
$this->drupalGet('<front>');
$this->assertSession()->responseContains('css/components/action-links.css?');
......
......@@ -43,13 +43,12 @@ protected function setUp(): void {
* Tests password widget theme functions and its deprecations.
*
* @group legacy
*
* @expectedDeprecation Javascript Deprecation: Returning <span> without data-drupal-selector="password-match-status-text" attribute is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3152101
* @expectedDeprecation Javascript Deprecation: The js-password-strength__indicator class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__indicator with a data-drupal-selector="password-strength-indicator" attribute. See https://www.drupal.org/node/3152101
* @expectedDeprecation Javascript Deprecation: The js-password-strength__text class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__text with a data-drupal-selector="password-strength-text" attribute. See https://www.drupal.org/node/3152101
* @expectedDeprecation Javascript Deprecation: The message property is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The markup should be constructed using messageTips property and Drupal.theme.passwordSuggestions. See https://www.drupal.org/node/3130352
*/
public function testPasswordConfirmWidgetJsComponents() {
$this->expectDeprecation('Javascript Deprecation: Returning <span> without data-drupal-selector="password-match-status-text" attribute is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3152101');
$this->expectDeprecation('Javascript Deprecation: The js-password-strength__indicator class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__indicator with a data-drupal-selector="password-strength-indicator" attribute. See https://www.drupal.org/node/3152101');
$this->expectDeprecation('Javascript Deprecation: The js-password-strength__text class is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Replace js-password-strength__text with a data-drupal-selector="password-strength-text" attribute. See https://www.drupal.org/node/3152101');
$this->expectDeprecation('Javascript Deprecation: The message property is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The markup should be constructed using messageTips property and Drupal.theme.passwordSuggestions. See https://www.drupal.org/node/3130352');
$assert_session = $this->assertSession();
$this->drupalGet($this->testUser->toUrl('edit-form'));
......
......@@ -25,9 +25,9 @@ class UserAuthenticationControllerTest extends KernelTestBase {
/**
* @group legacy
* @expectedDeprecation Passing the flood service to Drupal\user\Controller\UserAuthenticationController::__construct is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148
*/
public function testConstructorDeprecations() {
$this->expectDeprecation('Passing the flood service to Drupal\user\Controller\UserAuthenticationController::__construct is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148');
$flood = $this->prophesize(FloodInterface::class);
$user_storage = $this->prophesize(UserStorageInterface::class);
$csrf_token = $this->prophesize(CsrfTokenGenerator::class);
......
......@@ -22,9 +22,9 @@ class UserLoginFormTest extends KernelTestBase {
/**
* @group legacy
* @expectedDeprecation Passing the flood service to Drupal\user\Form\UserLoginForm::__construct is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148
*/
public function testConstructorDeprecations() {
$this->expectDeprecation('Passing the flood service to Drupal\user\Form\UserLoginForm::__construct is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148');
$flood = $this->prophesize(FloodInterface::class);
$user_storage = $this->prophesize(UserStorageInterface::class);
$user_auth = $this->prophesize(UserAuthInterface::class);
......
......@@ -17,10 +17,8 @@ class UserLegacyTest extends KernelTestBase {
*/
protected static $modules = ['user'];
/**
* @expectedDeprecation user_password() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Password\PasswordGeneratorInterface::generate() instead. See https://www.drupal.org/node/3153113
*/
public function testUserPassword() {
$this->expectDeprecation('user_password() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Password\PasswordGeneratorInterface::generate() instead. See https://www.drupal.org/node/3153113');
$this->assertNotEmpty(user_password());
}
......
......@@ -71,10 +71,9 @@ public function testNeedsEntityLinkUrlUpdate() {
/**
* @covers ::needsEntityLinkUrlUpdate
*
* @expectedDeprecation The entity link url update for the "node_link_update_test" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.
*/
public function testNeedsEntityLinkUrlUpdateDeprecation() {
$this->expectDeprecation('The entity link url update for the "node_link_update_test" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.');
$test_view = $this->loadTestView('views.view.node_link_update_test');
$needs_update = $this->configUpdater->needsEntityLinkUrlUpdate($test_view);
$this->assertTrue($needs_update);
......@@ -92,10 +91,9 @@ public function testNeedsOperatorUpdateDefaults() {
/**
* @covers ::needsOperatorDefaultsUpdate
*
* @expectedDeprecation The operator defaults update for the "test_exposed_filters" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2869168.
*/
public function testNeedsOperatorDefaultsUpdateDeprecation() {
$this->expectDeprecation('The operator defaults update for the "test_exposed_filters" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2869168.');
$test_view = $this->loadTestView('views.view.test_exposed_filters');
$needs_update = $this->configUpdater->needsOperatorDefaultsUpdate($test_view);
$this->assertTrue($needs_update);
......@@ -113,10 +111,9 @@ public function testNeedsFieldNamesForMultivalueBaseFieldsUpdate() {
/**
* @covers ::needsMultivalueBaseFieldUpdate
*
* @expectedDeprecation The multivalue base field update for the "test_user_multi_value" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2900684.
*/
public function testNeedsFieldNamesForMultivalueBaseUpdateFieldsDeprecation() {
$this->expectDeprecation('The multivalue base field update for the "test_user_multi_value" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2900684.');
$test_view = $this->loadTestView('views.view.test_user_multi_value');
$needs_update = $this->configUpdater->needsMultivalueBaseFieldUpdate($test_view);
$this->assertTrue($needs_update);
......@@ -124,12 +121,11 @@ public function testNeedsFieldNamesForMultivalueBaseUpdateFieldsDeprecation() {
/**
* @covers ::updateAll
*
* @expectedDeprecation The entity link url update for the "node_link_update_test" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.
* @expectedDeprecation The operator defaults update for the "test_exposed_filters" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2869168.
* @expectedDeprecation The multivalue base field update for the "test_user_multi_value" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2900684.
*/
public function testUpdateAll() {
$this->expectDeprecation('The entity link url update for the "node_link_update_test" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.');
$this->expectDeprecation('The operator defaults update for the "test_exposed_filters" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2869168.');
$this->expectDeprecation('The multivalue base field update for the "test_user_multi_value" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2900684.');
$view_ids = [
'views.view.node_link_update_test',
'views.view.test_exposed_filters',
......
......@@ -18,10 +18,11 @@ class JavascriptDeprecationTest extends WebDriverTestBase {
protected $defaultTheme = 'stark';
/**
* @expectedDeprecation Javascript Deprecation: This function is deprecated for testing purposes.
* @expectedDeprecation Javascript Deprecation: This property is deprecated for testing purposes.
* Tests Javascript deprecation notices.
*/
public function testJavascriptDeprecation() {
$this->expectDeprecation('Javascript Deprecation: This function is deprecated for testing purposes.');
$this->expectDeprecation('Javascript Deprecation: This property is deprecated for testing purposes.');
$this->drupalGet('js_deprecation_test');
// Ensure that deprecation message from previous page loads will be
// detected.
......
......@@ -254,9 +254,9 @@ public function testInvalidLinkNotExistsExact() {
* Tests legacy assertResponse().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertResponse() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->statusCodeEquals() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertResponse() {
$this->expectDeprecation('AssertLegacyTrait::assertResponse() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->statusCodeEquals() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-encoded');
$this->assertResponse(200);
}
......@@ -265,9 +265,9 @@ public function testAssertResponse() {
* Tests legacy assertTitle().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertTitle() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertTitle() {
$this->expectDeprecation('AssertLegacyTrait::assertTitle() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-encoded');
$this->assertTitle("Page with encoded HTML | Drupal");
}
......@@ -276,9 +276,9 @@ public function testAssertTitle() {
* Tests legacy assertHeader().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertHeader() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderEquals() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertHeader() {
$this->expectDeprecation('AssertLegacyTrait::assertHeader() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderEquals() instead. See https://www.drupal.org/node/3129738');
$account = $this->drupalCreateUser();
$this->drupalLogin($account);
$this->drupalGet('test-page');
......@@ -300,9 +300,9 @@ public function testTextAsserts() {
* Tests legacy assertPattern().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertPattern() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseMatches() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertPattern() {
$this->expectDeprecation('AssertLegacyTrait::assertPattern() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseMatches() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-escaped-characters');
$this->assertPattern('/div class.*escaped/');
}
......@@ -311,9 +311,9 @@ public function testAssertPattern() {
* Tests legacy getRawContent().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::getRawContent() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->getPage()->getContent() instead. See https://www.drupal.org/node/3129738
*/
public function testGetRawContent() {
$this->expectDeprecation('AssertLegacyTrait::getRawContent() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->getSession()->getPage()->getContent() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-encoded');
$this->assertSame($this->getSession()->getPage()->getContent(), $this->getRawContent());
}
......@@ -322,9 +322,9 @@ public function testGetRawContent() {
* Tests legacy buildXPathQuery().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::buildXPathQuery() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->buildXPathQuery() instead. See https://www.drupal.org/node/3129738
*/
public function testBuildXPathQuery() {
$this->expectDeprecation('AssertLegacyTrait::buildXPathQuery() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->buildXPathQuery() instead. See https://www.drupal.org/node/3129738');
$this->buildXPathQuery('\\html');
}
......@@ -375,10 +375,10 @@ public function testXpathAsserts() {
* Tests legacy field asserts using textfields.
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertField() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoField() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertField() {
$this->expectDeprecation('AssertLegacyTrait::assertField() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertNoField() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-field-xpath');
$this->assertField('name');
$this->assertNoField('invalid_name_and_id');
......@@ -388,10 +388,10 @@ public function testAssertField() {
* Tests legacy field asserts by id.
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertFieldById() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() or $this->assertSession()->fieldValueEquals() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoFieldById() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead. See https://www.drupal.org/node/3129738
*/
public function testAssertFieldById() {
$this->expectDeprecation('AssertLegacyTrait::assertFieldById() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() or $this->assertSession()->fieldValueEquals() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertNoFieldById() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-field-xpath');
$this->assertFieldById('edit-save', NULL);
$this->assertNoFieldById('invalid', NULL);
......@@ -512,11 +512,11 @@ public function testFieldAssertsForTextfields() {
* Tests legacy field asserts for options field type.
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertOptionByText() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionNotExists() instead. See https://www.drupal.org/node/3129738
*/
public function testFieldAssertsForOptions() {
$this->expectDeprecation('AssertLegacyTrait::assertOptionByText() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertNoOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionNotExists() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-field-xpath');
// Option field type.
......@@ -605,10 +605,10 @@ public function testFieldAssertsForButton() {
* Tests legacy assertFieldChecked() and assertNoFieldChecked().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxChecked() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxNotChecked() instead. See https://www.drupal.org/node/3129738
*/
public function testLegacyFieldAssertsForCheckbox() {
$this->expectDeprecation('AssertLegacyTrait::assertFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxChecked() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertNoFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxNotChecked() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-field-xpath');
$this->assertFieldChecked('edit-checkbox-enabled');
$this->assertNoFieldChecked('edit-checkbox-disabled');
......@@ -843,10 +843,10 @@ public function testEscapingAssertions() {
* Tests deprecation of legacy assertEscaped() and assertNoEscaped().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertNoEscaped() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertNoEscaped() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertEscaped() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertEscaped() instead. See https://www.drupal.org/node/3129738
*/
public function testLegacyEscapingAssertions(): void {
$this->expectDeprecation('AssertLegacyTrait::assertNoEscaped() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertNoEscaped() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertEscaped() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->assertEscaped() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-escaped-characters');
$this->assertNoEscaped('<div class="escaped">');
$this->assertEscaped('Escaped: <"\'&>');
......@@ -856,9 +856,9 @@ public function testLegacyEscapingAssertions(): void {
* Tests deprecation of drupalPostForm().
*
* @group legacy
* @expectedDeprecation Calling Drupal\Tests\UiHelperTrait::drupalPostForm() with $edit set to NULL is deprecated in drupal:9.1.0 and the method is removed in drupal:10.0.0. Use $this->submitForm() instead. See https://www.drupal.org/node/3168858
*/
public function testLegacyDrupalPostForm(): void {
$this->expectDeprecation('Calling Drupal\Tests\UiHelperTrait::drupalPostForm() with $edit set to NULL is deprecated in drupal:9.1.0 and the method is removed in drupal:10.0.0. Use $this->submitForm() instead. See https://www.drupal.org/node/3168858');
$this->drupalPostForm(NULL, NULL, '');
}
......@@ -899,10 +899,10 @@ public function testDeprecationHeaders() {
* Tests legacy assertFieldByName() and assertNoFieldByName().
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertFieldByName() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() or $this->assertSession()->fieldValueEquals() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoFieldByName() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead. See https://www.drupal.org/node/3129738
*/
public function testLegacyFieldAssertsByName() {
$this->expectDeprecation('AssertLegacyTrait::assertFieldByName() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() or $this->assertSession()->fieldValueEquals() instead. See https://www.drupal.org/node/3129738');
$this->expectDeprecation('AssertLegacyTrait::assertNoFieldByName() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('test-field-xpath');
$this->assertFieldByName('checkbox_enabled', TRUE);
$this->assertNoFieldByName('checkbox_enabled', FALSE);
......
......@@ -26,10 +26,9 @@ class AssertLegacyTraitDeprecatedTest extends BrowserTestBase {
/**
* Tests getAllOptions().
*
* @expectedDeprecation AssertLegacyTrait::getAllOptions() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $element->findAll('xpath', 'option') instead. See https://www.drupal.org/node/3129738
*/
public function testGetAllOptions() {
$this->expectDeprecation('AssertLegacyTrait::getAllOptions() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $element->findAll(\'xpath\', \'option\') instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('/form-test/select');
$this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0]));
}
......
......@@ -21,16 +21,18 @@ class PhpUnitBridgeTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* @expectedDeprecation This is the deprecation message for deprecation_test_function().
* Tests deprecation message from deprecation_test_function().
*/
public function testSilencedError() {
$this->expectDeprecation('This is the deprecation message for deprecation_test_function().');
$this->assertEquals('known_return_value', deprecation_test_function());
}
/**
* @expectedDeprecation This is the deprecation message for deprecation_test_function().
* Tests deprecation message from deprecated route.
*/
public function testErrorOnSiteUnderTest() {
$this->expectDeprecation('This is the deprecation message for deprecation_test_function().');
$this->drupalGet(Url::fromRoute('deprecation_test.route'));
}
......
......@@ -217,13 +217,12 @@ public function testLibrariesExtend() {
* Test deprecated libraries.
*
* @group legacy
*
* @expectedDeprecation Theme "theme_test" is overriding a deprecated library. The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com
* @expectedDeprecation Theme "theme_test" is extending a deprecated library. The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com
* @expectedDeprecation The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com
* @expectedDeprecation The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com
*/
public function testDeprecatedLibrary() {
$this->expectDeprecation('Theme "theme_test" is overriding a deprecated library. The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->expectDeprecation('Theme "theme_test" is extending a deprecated library. The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->expectDeprecation('The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->expectDeprecation('The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->activateTheme('test_legacy_theme');
$this->libraryDiscovery->getLibraryByName('theme_test', 'deprecated_library');
$this->libraryDiscovery->getLibraryByName('theme_test', 'another_deprecated_library');
......
......@@ -21,10 +21,9 @@ class ConfigSchemaDeprecationTest extends KernelTestBase {
/**
* Tests config schema deprecation.
*
* @expectedDeprecation The 'complex_structure_deprecated' config schema is deprecated in drupal:9.1.0 and is removed from drupal 10.0.0. Use the 'complex_structure' config schema instead. See http://drupal.org/node/the-change-notice-nid.
*/
public function testConfigSchemaDeprecation() {
$this->expectDeprecation('The \'complex_structure_deprecated\' config schema is deprecated in drupal:9.1.0 and is removed from drupal 10.0.0. Use the \'complex_structure\' config schema instead. See http://drupal.org/node/the-change-notice-nid.');
$config = $this->config('config_schema_deprecated_test.settings');
$config
->set('complex_structure_deprecated.type', 'fruits')
......
......@@ -14,9 +14,10 @@
class ConfigStorageStagingTest extends KernelTestBase {
/**
* @expectedDeprecation The "config.storage.staging" service is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the "config.storage.sync" service instead. See https://www.drupal.org/node/2574957
* Tests deprecation of the "config.storage.staging" service.
*/
public function testConfigStorageStagingDeprecation() {
$this->expectDeprecation('The "config.storage.staging" service is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the "config.storage.sync" service instead. See https://www.drupal.org/node/2574957');
$storage_staging = \Drupal::service('config.storage.staging');
// Ensure at least one assertion.
$this->assertInstanceOf(FileStorage::class, $storage_staging);
......
......@@ -122,10 +122,10 @@ public function testConnectionOptions() {
* Tests the deprecation of the 'transactions' connection option.
*
* @group legacy
* @expectedDeprecation Passing a 'transactions' connection option to Drupal\Core\Database\Connection::__construct is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. All database drivers must support transactions. See https://www.drupal.org/node/2278745
* @expectedDeprecation Drupal\Core\Database\Connection::supportsTransactions is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. All database drivers must support transactions. See https://www.drupal.org/node/2278745
*/
public function testTransactionsOptionDeprecation() {
$this->expectDeprecation('Passing a \'transactions\' connection option to Drupal\Core\Database\Connection::__construct is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. All database drivers must support transactions. See https://www.drupal.org/node/2278745');
$this->expectDeprecation('Drupal\Core\Database\Connection::supportsTransactions is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. All database drivers must support transactions. See https://www.drupal.org/node/2278745');
$connection_info = Database::getConnectionInfo('default');
$connection_info['default']['transactions'] = FALSE;
Database::addConnectionInfo('default', 'foo', $connection_info['default']);
......
......@@ -17,9 +17,9 @@ class DatabaseExceptionWrapperTest extends KernelTestBase {
* Tests deprecation of Connection::prepare.
*
* @group legacy
* @expectedDeprecation Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Connection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786
*/
public function testPrepare() {
$this->expectDeprecation('Connection::prepare() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should instantiate \PDOStatement objects by calling \PDO::prepare in their Connection::prepareStatement method instead. \PDO::prepare should not be called outside of driver code. See https://www.drupal.org/node/3137786');
$connection = Database::getConnection();
try {
// SQLite validates the syntax upon preparing a statement already.
......@@ -41,9 +41,9 @@ public function testPrepare() {
* Tests deprecation of Connection::prepareQuery.
*
* @group legacy
* @expectedDeprecation Connection::prepareQuery() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::prepareStatement() instead. See https://www.drupal.org/node/3137786
*/
public function testPrepareQuery() {
$this->expectDeprecation('Connection::prepareQuery() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::prepareStatement() instead. See https://www.drupal.org/node/3137786');
$this->expectException(\PDOException::class);
$stmt = Database::getConnection()->prepareQuery('bananas');
$stmt->execute();
......
......@@ -18,9 +18,9 @@ class ModuleHandlerDeprecatedHookTest extends KernelTestBase {
/**
* @covers ::invokeDeprecated
* @expectedDeprecation The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.
*/
public function testInvokeDeprecated() {
$this->expectDeprecation('The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.');
/* @var $module_handler \Drupal\Core\Extension\ModuleHandlerInterface */
$module_handler = $this->container->get('module_handler');
$arg = 'an_arg';
......@@ -32,9 +32,9 @@ public function testInvokeDeprecated() {
/**
* @covers ::invokeAllDeprecated
* @expectedDeprecation The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.
*/
public function testInvokeAllDeprecated() {
$this->expectDeprecation('The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.');
/* @var $module_handler \Drupal\Core\Extension\ModuleHandlerInterface */
$module_handler = $this->container->get('module_handler');
$arg = 'an_arg';
......@@ -46,9 +46,9 @@ public function testInvokeAllDeprecated() {
/**
* @covers ::alterDeprecated
* @expectedDeprecation The deprecated alter hook hook_deprecated_alter_alter() is implemented in these functions: deprecation_test_deprecated_alter_alter. Alter something else.
*/
public function testAlterDeprecated() {
$this->expectDeprecation('The deprecated alter hook hook_deprecated_alter_alter() is implemented in these functions: deprecation_test_deprecated_alter_alter. Alter something else.');
/* @var $module_handler \Drupal\Core\Extension\ModuleHandlerInterface */
$module_handler = $this->container->get('module_handler');
$data = [];
......
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