Remove PHP 5.3 $this closure workaround

Change-Id: Ic1f8147e85ad751927153d5a8f6330d37800aacb
This commit is contained in:
Kunal Mehta 2021-05-14 10:25:15 -07:00
parent b86678892c
commit 8055732ae0

View file

@ -64,22 +64,21 @@ class ApiFlowThankIntegrationTest extends ApiTestCase {
$mockLoader = $this->getMockBuilder( \Flow\Repository\RootPostLoader::class )
->disableOriginalConstructor()
->getMock();
$that = $this;
$mockLoader->expects( $this->any() )
->method( 'getWithRoot' )
->willReturnCallback(
function ( $postId ) use ( $that ) {
function ( $postId ) {
switch ( $postId ) {
case $that->postByOtherUser->getPostId():
case $this->postByOtherUser->getPostId():
return [
'post' => $that->postByOtherUser,
'root' => $that->topic
'post' => $this->postByOtherUser,
'root' => $this->topic
];
case $that->postByMe->getPostId():
case $this->postByMe->getPostId():
return [
'post' => $that->postByMe,
'root' => $that->topic
'post' => $this->postByMe,
'root' => $this->topic
];
default: