Problem/Motivation

Drupal\language\Plugin\Condition\Language does not take the language manager injected and is not unit tested.

Proposed resolution

Inject language manager, unit test.

Remaining tasks

All of them.

User interface changes

None.

API changes

Likely none.

CommentFileSizeAuthor
#2 2328463-languagemanager_injected-2.patch839 bytesjanoka
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janoka’s picture

Assigned: Unassigned » janoka

I'll check it.

janoka’s picture

Status: Active » Needs review
FileSize
839 bytes

Please check my code. Do you think that solution? If yes, then I will write the unit test.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

Certainly better than using language_list() :) Actually injecting the language manager would mean you pass on an instance of $language_manager as a property to either the constructor or create method or a specific setter method that is used to set dependent services on conditions. See https://www.drupal.org/node/2133171 for explanation on various ways of of injection and check what conditions use elsewhere. (They may not support injection yet but hopefully they do :)

janoka’s picture

Status: Needs work » Active
janoka’s picture

Status: Active » Needs work
janoka’s picture

I started check it again.

janoka’s picture

janoka’s picture

Status: Needs work » Closed (duplicate)