Tests should always use own container

CommentFileSizeAuthor
#5 views_test_container-2021831-5.patch7.44 KBplopesc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kgoel’s picture

This issue is being addressed here - https://drupal.org/node/2014043. May be this is a duplicate?

andypost’s picture

No it's not about container - it's about Views::

pwieck’s picture

I was told that all tests use container because it inherits from parent. Which way is correct?

David Hernández’s picture

Hi there,

I'm trying to create this patch but it wasn't as easy as looks like. I found the Views:: usage in this 4 tests:

ModuleTest
Plugin/JoinTest
Plugin/FilterTest
Handler/HandlerAllTest

The provided solution doesn't work with those tests, but on the test Handler/AreaEntityTest the change is already there and working. So I'm wondering if this change is already done or I'm missing something.

If someone can provide a bit more of information, I will continue working on this.

Regards,
David.

plopesc’s picture

Title: Replace usage of Views:: in tests with $this->container->get('views.views_data') » Replace usage of Views:: in tests with its own services
FileSize
7.44 KB

Hello,

I've been working on this issue and removed the static calls to Views:: with its corresponding service in its own container.

Problem with issue title is that there are more services and not only $this->container->get('views.views_data') .

Patch attached.

Regards

plopesc’s picture

Status: Active » Needs review

Changing status.

David Hernández’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed. Now working fine.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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