Problem/Motivation

drupal-check results on commit hash: source : [git] https://git.drupal.org/project/maxlength 3235f5ca1a7532b29612b027f02f949bde2bbe5f
source : http://cgit.drupalcode.org/maxlength


 

 ------ ------------------------------------------------------------------------------- 
  Line   tests/src/FunctionalJavascript/MaxlengthCustomWidgetTest.php                   
 ------ ------------------------------------------------------------------------------- 
  13     Class Drupal\Tests\maxlength\FunctionalJavascript\MaxlengthCustomWidgetTest    
         extends deprecated class Drupal\FunctionalJavascriptTests\JavascriptTestBase.  
  30     Call to method setUp() of deprecated class Drupal\Tests\BrowserTestBase.       
 ------ ------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   tests/src/FunctionalJavascript/MaxlengthJavascriptTest.php                         
 ------ ----------------------------------------------------------------------------------- 
  16     Class Drupal\Tests\maxlength\FunctionalJavascript\MaxlengthJavascriptTest extends  
         deprecated class Drupal\FunctionalJavascriptTests\JavascriptTestBase.              
 ------ ----------------------------------------------------------------------------------- 

 [ERROR] Found 3 errors                                                                    
 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mcdwayne created an issue. See original summary.

nlisgo’s picture

Assigned: Unassigned » nlisgo

I'm going to take a look at this one. Looks like a case of simpletest to phpunit migration.

nlisgo’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB
nlisgo’s picture

Assigned: nlisgo » Unassigned

Status: Needs review » Needs work

The last submitted patch, 3: 3042749-3.patch, failed testing. View results

nlisgo’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB
new2.44 KB

The statusCodeEquals check isn't adding anything here, I believe. Has just been removed in other similar instances: (For example: https://www.drupal.org/project/drupal/issues/2942900).

berdir’s picture

Status: Needs review » Needs work

Removing them makes sense to me.

Lets also add $defaultTheme now to these tests, and the core_version_requirement key per https://www.drupal.org/node/3070687.

I also had a schema error when trying to run the tests locally, not sure what's up with that.

shuva.15’s picture

StatusFileSize
new1.57 KB

The deprecated code was not updated for test files. I have updated them accordingly.

akashkumar07’s picture

primsi’s picture

Addressed #7. Got schema errors too, not quite sure about the connection there.

primsi’s picture

Status: Needs work » Needs review
primsi’s picture

Status: Needs review » Needs work
berdir’s picture

Tests fail because of running them with PHP 5.6

+++ b/maxlength.info.yml
@@ -1,5 +1,5 @@
 description: 'Limit the number of characters in textfields and textareas and shows the amount of characters left.'
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 package: Fields
diff --git a/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml b/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml

diff --git a/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml b/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml
index 0e7b2a2..d9d1fdd 100755

index 0e7b2a2..d9d1fdd 100755
--- a/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml

--- a/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml
+++ b/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml

+++ b/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml
+++ b/tests/modules/maxlength_custom_widget_test/maxlength_custom_widget_test.info.yml
@@ -1,4 +1,3 @@

@@ -1,4 +1,3 @@
-core: '8.x'
 name: 'Maxlength custom widget test'
 type: module

we should only require 8.8 if that's actually necessary, much easier to get ^8.7.7 patches committed.

That means we also need it in the test module, as support for leaving it out for test modules is only in 8.8.x (not even in a release yet afaik)

primsi’s picture

Status: Needs work » Needs review
StatusFileSize
new881 bytes
new3.87 KB

Addressed #13

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Hm, failed against 8.8, could be that something with the classes doesn't work with the stark theme? (8.7 doesn't respect that so maybe that's why it passes)

berdir’s picture

Status: Reviewed & tested by the community » Needs work

Meant to set to needs work.

primsi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.88 KB
new4.68 KB

Switching to classy and addressing the schema error.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Yay. This now doesn't just make it compatible with D9 but also fixes the tests for 8.8.

  • dawehner committed 8df6794 on 8.x-1.x authored by Primsi
    Issue #3042749 by Primsi, nlisgo, shuva.15: Drupal 9 Deprecated Code...
dawehner’s picture

Status: Reviewed & tested by the community » Fixed

This looks great, thank you for the good minimal set of changes!
Commited, pushed and tagged as beta5

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.