title: PHP Fatal error: Cannot use $this as parameter
body: <p>I've the following PHP method which is part of the codebase which was working fine:</p>
  <pre><code>&lt;?php
  class HooksTest extends DrupalTestCase {
    public function testPageAlterIsLoggedIn() {
      $this-&gt;drupal-&gt;shouldReceive('userIsLoggedIn')
        -&gt;once()
        -&gt;andReturn(TRUE);
      $this-&gt;drupal-&gt;shouldReceive('drupalPageIsCacheable')
        -&gt;once()
        -&gt;andReturnUsing(function ($this) {
          return $this;
        });
      $page = [];
      $cacheable = $this-&gt;object-&gt;pageAlter($page);
      $this-&gt;assertFalse($cacheable);
    }
  }
  </code></pre>
  <p>The code was passing all the CI tests before (using <code>phpunit</code>).</p>
  <p>However now when I'm invoking the file via <code>php HooksTest.php</code>, I've got the following error:</p>
  <blockquote>
  <p>PHP Fatal error:  Cannot use <strong><code>$this</code></strong> as parameter in <code>HooksTest.php</code> on line 11</p>
  <p>Fatal error: Cannot use <strong><code>$this</code></strong> as parameter in <code>HooksTest.php</code> on line 11</p>
  </blockquote>
  <p>I've tested with PHP 7.1, 7.2 and same issue. I believe it was working in PHP 5.6.</p>
  <p>How can I convert above code to have the same meaning?</p>
  <p>Does removing <code>$this</code> from the function parameter should be enough?</p>