Move to new test path in NodeTest as per todo.

Created on 26 May 2024, 4 months ago
Updated 21 June 2024, 3 months ago

Problem/Motivation

Parent issue works as designed, we need to move along and try and execute: /Users/bjorn/projects/drupal/core/modules/jsonapi/tests/src/Functional/NodeTest.php:341. Which is a todo to remove some code when the issue is closed.

Steps to reproduce

Proposed resolution

Remove the code, enable new code as per comment in referenced line. See if all is good.

Remaining tasks

Remove the code
See all is happy and fine
...
Profit ;)

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
JSON API 

Last updated 1 day ago

Created by

🇳🇱Netherlands bbrala Netherlands

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bbrala
  • Assigned to NexusNovaz
  • 🇬🇧United Kingdom NexusNovaz

    Ill pick this one up

  • Pipeline finished with Failed
    4 months ago
    Total: 507s
    #182594
  • Issue was unassigned.
  • Status changed to Needs work 4 months ago
  • 🇬🇧United Kingdom NexusNovaz

    Hi, i think the Remaining tasks needs to be revised. I've removed the old test and uncommented the new one. The test can be viewed here with a failure.

  • 🇳🇱Netherlands bbrala Netherlands

    If you look at the arguments for assertResourceErrorResponse you see that your arguments to not correcpond with the right ones. The $response variable is in the wrong position. Check out the function arguments, and you should be able to fix that pretty easily by adding a NULL as the $via_link argument. :)

  • 🇬🇧United Kingdom NexusNovaz

    Hi @bbrala,

    I'm unable to get the test to pass. I'm getting the following fail message with $url:

    PHPUnit 9.6.19 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.1.27
    Configuration: ./core/phpunit.xml.dist
    
    Testing Drupal\Tests\jsonapi\Functional\NodeTest
    .F..........                                                      12 / 12 (100%)
    
    Time: 01:16.183, Memory: 6.00 MB
    
    There was 1 failure:
    
    1) Drupal\Tests\jsonapi\Functional\NodeTest::testGetIndividual
    The 'errors' member was not as expected.
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
             1 => 'Forbidden'
             2 => 'The current user is not allow...ource.'
             3 => Array (
    -            0 => Array (...)
    -            1 => Array (...)
    +            0 => '/data'
             )
    +        4 => Array (...)
         )
     )
    

    Or the following error message with NULL:

    PHPUnit 9.6.19 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.1.27
    Configuration: ./core/phpunit.xml.dist
    
    Testing Drupal\Tests\jsonapi\Functional\NodeTest
    .F..........                                                      12 / 12 (100%)
    
    Time: 01:17.307, Memory: 6.00 MB
    
    There was 1 failure:
    
    1) Drupal\Tests\jsonapi\Functional\NodeTest::testGetIndividual
    The 'errors' member was not as expected.
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
             1 => 'Forbidden'
             2 => 'The current user is not allow...ource.'
             3 => Array (
    -            0 => Array (...)
    +            0 => '/data'
             )
    +        4 => Array (...)
         )
     )
    

    As im unsure what to do, ill leave this for someone else and check up once complete to learn from the solution.

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 513s
    #191868
  • Status changed to Needs review 3 months ago
  • 🇮🇳India manish-31

    MR has been updated, fixed PHPUnit tests errors. Needs review.

  • Status changed to RTBC 3 months ago
  • 🇺🇸United States smustgrave

    Seems straightforward

    Just fyi @manish-31 this was tagged for novice/new users. Looking at your post history of multiple pages believe are good to work on non-novice level issues.

  • Status changed to Fixed 3 months ago
  • 🇬🇧United Kingdom longwave UK

    Committed and pushed 6f6fabe2e6b to 11.x and a83ff827fd4 to 11.0.x and bccb004ae24 to 10.4.x and 389f46becaa to 10.3.x. Thanks!

    • longwave committed 3fd288da on 10.3.x
      Issue #3449891 by NexusNovaz, manish-31, bbrala: Move to new test path...
    • longwave committed f5ecdb8f on 10.4.x
      Issue #3449891 by NexusNovaz, manish-31, bbrala: Move to new test path...
    • longwave committed 1dd4e982 on 11.0.x
      Issue #3449891 by NexusNovaz, manish-31, bbrala: Move to new test path...
    • longwave committed 11ce3c83 on 11.x
      Issue #3449891 by NexusNovaz, manish-31, bbrala: Move to new test path...
  • 🇬🇧United Kingdom longwave UK
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024