Run against commit df38165d74514d174f8928b5708bcc393650c39a.

 ------ -----------------------------------------------------------------------------------------
  Line   modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php
 ------ -----------------------------------------------------------------------------------------
  58     Call to deprecated method assertFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  69     Call to deprecated method assertRaw() of class Drupal\Tests\BrowserTestBase.
  86     Call to deprecated method assertRaw() of class Drupal\Tests\BrowserTestBase.
  103    Call to deprecated method assertFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  158    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
  159    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.
  175    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
  176    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
  192    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
  193    Call to deprecated method assertNoText() of class Drupal\Tests\BrowserTestBase.
  250    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  265    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  266    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  273    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  278    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  281    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  303    Call to deprecated method assertFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  304    Call to deprecated method assertFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  320    Call to deprecated method assertNoFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  321    Call to deprecated method assertNoFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  332    Call to deprecated method assertFieldByXPath() of class Drupal\Tests\BrowserTestBase.
  344    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  354    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
  361    Call to deprecated method assertEqual() of class Drupal\Tests\BrowserTestBase.
 ------ -----------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Tests/Wizard/CToolsWizardTest.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------
         Class Drupal\Tests\ctools\Functional\CToolsWizardTest was not found while trying to analyse it - autoloading is probably not configured properly.
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

josephdpurcell created an issue. See original summary.

benjifisher’s picture

joelpittet’s picture

@josephdpurcell could you run that against dev? I think half of those are fixed.

josephdpurcell’s picture

Issue summary: View changes

Yes! Sorry! I've updated the description to use a report against the latest dev.

benjifisher’s picture

joelpittet’s picture

Thanks you, did you want to tackle those?

Is this part of a master plan for D9 @benjifisher?

benjifisher’s picture

@joelpittet:

The immediate plan is to kick-start the process during the contribution day (tomorrow, 2019-03-23) at MidCamp. We plan to generate a lot of reports like the one in the IS here. For now, we want to get an idea of how much work there is to be done.

Once we get through the list of the 100 most-installed modules, maybe we will have time to start fixing the deprecations.

To find the other issues, search for the issue tag: Drupal 9 compatibility.

joelpittet’s picture

Thanks @benjifisher for bringing me up-to-date.

thalles’s picture

Status: Active » Needs review
FileSize
2.74 KB

Follow the patch!

Status: Needs review » Needs work
joelpittet’s picture

@thalles have a look at the docblock above assertFieldByXPath it will give you hints how to do it. For all of those because the value is NULL you can do something like this:

$fields = $this->xpath($xpath);
$this->assertTrue($fields);
thalles’s picture

Would it be this?

     $fields = $this->xpath('//input[@type="number" and @name="settings[override][pager_offset]"]');
    $this->assertTrue($fields, 'items_per_page setting is a number field');
joelpittet’s picture

I believe so, yes, give that a try for all of those.

thalles’s picture

Status: Needs work » Needs review
FileSize
2.67 KB

Follow the patch!

thalles’s picture

Follow the most complete patch!

Status: Needs review » Needs work
joelpittet’s picture

+++ b/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php
@@ -262,23 +262,23 @@ class CToolsViewsBasicViewBlockTest extends UITestBase {
-    $this->assertEqual(-46, $config['fields']['id']['weight'], "'sort_fields' setting is properly saved.");
-    $this->assertEqual(-50, $config['fields']['name']['weight'], "'sort_fields' setting is properly saved.");
+    $this->assertEquals($config['fields']['id']['weight'], "'sort_fields' setting is properly saved.", -46);
+    $this->assertEquals($config['fields']['name']['weight'], "'sort_fields' setting is properly saved.", -50);

These ones the expected value is in argument 3 instead of 2

I'm not sure about the page 1 response, maybe it's in an attribute of an HTML tag or something?

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
15.9 KB
20.84 KB

Re #17 it looks like that was fixed on #3043399: Replace deprecated assertEqual() in CToolsViewsBasicViewBlockTest file already, rerolling.

Also fixing my own review while I was at it:

+++ b/modules/ctools_views/src/Tests/CToolsViewsBasicViewBlockTest.php
@@ -300,8 +300,8 @@ class CToolsViewsBasicViewBlockTest extends UITestBase {
-    $this->assertFieldByXPath('//select[@name="status"]');
-    $this->assertFieldByXPath('//input[@name="job"]');
+    $this->assertTrue($this->xpath('//select[@name="status"]'));
+    $this->assertTrue($this->xpath('//input[@name="job"]'));

@@ -329,7 +329,7 @@ class CToolsViewsBasicViewBlockTest extends UITestBase {
-    $this->assertFieldByXPath('//input[@name="settings[override][sort][id][order]"]');
+    $this->assertTrue($this->xpath('//input[@name="settings[override][sort][id][order]"]'));

I believe these should rather use $this->assertSession()->fieldExists()

Manuel Garcia’s picture

FileSize
1.31 KB
5.01 KB

Jesus, wrong patches sorry.

Manuel Garcia’s picture

We should also use pageTextNotContains since we're checking for text only.

The last submitted patch, 19: 3041908-18.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 20: 3041908-20.patch, failed testing. View results

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
1.45 KB
5 KB
1) Drupal\ctools_views\Tests\CToolsViewsBasicViewBlockTest::testPager
Behat\Mink\Exception\ResponseTextException: The text "Page 1" appears in the text of this page, but it should not.

Test needs adjustment because its picking up the valid text:
Displaying 1 - 3 of 5 Showing 3 records on page 1

In reality what we're trying to do here is assert that the pager isn't displayed, so I propose we check the existence of the element itself.

thalles’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all, I've committed this to the latest dev branch.

Status: Fixed » Closed (fixed)

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