Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291566

ViewExecutableTest::testAddHandler and ::testAddHandlerWithEntityField are misusing the mock expectation?

$
0
0

Problem/Motivation

I have some doubts on these tests... what's the purpose of looping through

     foreach (['field', 'filter', 'argument', 'sort'] as $handler_type) {

to have

       $display->expects($this->atLeastOnce())
         ->method('setOption')
        ->with($this->anything(), [

? In the end, it will just pass if the method is only called once, but I suppose we expect at least to be called once per handler.

Proposed resolution

Fix the test so it makes sense.


Viewing all articles
Browse latest Browse all 291566

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>