Problem/Motivation

Fixing the tests in the branch and remove deprecated code from the tests

Steps to reproduce

Run tests

Proposed resolution

Functional Tests:

  • Add $defaultTheme variable
  • Change $modules from public to protected
  • Add void type hint to setUp function
  • Fix deprecated code

Unit Tests:

  • Fix \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.
  • Fix deprecated code
  • Fix remaining problems

Remaining tasks

Fix Functional Tests
Fix Unit Tests
Test it
Commit

Comments

hmendes created an issue. See original summary.

hmendes’s picture

Issue summary: View changes
Status: Active » Needs work
StatusFileSize
new3.41 KB

Adding a patch to fix the Functional tests.
The Unit tests still needs to be fixed, so changing this to needs work

daften’s picture

Component: Field widget (non-specific or listed) » Miscellaneous
Status: Needs work » Needs review
StatusFileSize
new0 bytes

I've fixed the unit tests, took a bit of time to fix all deprecations in phpunit, ... and then fix the tests. Let's see :)

daften’s picture

StatusFileSize
new62.13 KB

Something went wrong with the previous patch it seems

daften’s picture

StatusFileSize
new0 bytes

Fixed coding standards in the patch file.
@hmendes feel free to give feedback. If it's okay or no feedback by this weekend, I'll probably merge this patch.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues
beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
StatusFileSize
new60.62 KB

So, I tested and all the tests are passing, with no deprecation messages. I run phpcs command to find some code sniffs and I actually fixed some. (The patch before was empty :/ so that's why I worked on fix code standard again). Sending the patch here.

I will also open a issue to update the README file, 'cause the maintainers list there is very outdated.

Status: Needs review » Needs work

The last submitted patch, 7: 3239671-6-fix-tests.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

The tests are failing, i'll check why.

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
Status: Needs work » Needs review
StatusFileSize
new63.92 KB
new9.34 KB

I fixed the mistakes I did at the previous patch and I'm also sending a interdiff file :)

daften’s picture

Assigned: Unassigned » daften
StatusFileSize
new61.94 KB

Hi Beatriz. I still had my original file here and I'll use that one. There are some mistakes in your patch file it seems, I mainly don't understand why you've removed all the translation functions. If you feel that's needed, feel free to open a new issue with a separate patch file. I'll credit you for the work you've put in though, I appreciate the contribution a lot!

In attachment the patch file that will be used

  • daften committed 2c0e4a2 on 4.x
    Issue #3239671 by daften, beatrizrodrigues, hmendes: Fixing test in 4.x...
daften’s picture

Status: Needs review » Fixed
beatrizrodrigues’s picture

Oh, thank you @daften! I will check what I did wrong so I can do different in the future. About the translations functions, I talked with a colleague that is a drupal contributor here too, and we came to a conclusion that the functions were not necessary as it is a test, phpcs keeps throwing this warning about it, so I took it off. But if it is a good practice to let it, that's ok. Thank you again.

Status: Fixed » Closed (fixed)

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