Unclear replacement of getMockBuilder() with createMock().
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3300685. -->
Reported by: [cburschka](https://www.drupal.org/user/28680)
>>>
<h2>Drupal version</h2>
<p>10.0x</p>
<h2>Drupal Rector version</h2>
<p>0.13.0</p>
<h2>Problem / Motivation</h2>
<p>I am reviewing the automated changes proposed for the filelog module in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/filelog/issues/3287582" title="Status: Closed (fixed)">#3287582: Automated Drupal 10 compatibility fixes</a></span>, and I notice that the bot has made several changes of the following form:</p>
<pre>- $this->token = $this<br>- ->getMockBuilder(Token::class)<br>- ->disableOriginalConstructor()<br>- ->getMock();<br>+ $this->token = $this->createMock(Token::class);</pre><p>These do not seem to follow from the <a href="https://www.drupal.org/node/2907725">change record 2907725</a>, which is the only one mentioned in rector in relation to ::createMock(). Specifically, ::getMock() <em>was</em> deprecated, but ::getMockBuilder() was <em>not</em>. Also the deprecation was in Drupal 8 and the removal in Drupal 9, so it shouldn't be relevant for updating Drupal 9-compatible code to Drupal 10, right?</p>
<p>Am I just missing something here, or was the code replacement pattern too broad?</p>
issue