mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-19 11:21:27 +00:00
291ea47dd3
This might make dependencies easier to find. Change-Id: I158fd9f63f18a2b8da0368ac95d5fb5aa9bca3ff
25 lines
762 B
PHP
25 lines
762 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Test\Integration\Mapper;
|
|
|
|
use PHPUnit\Framework\MockObject\Invocation;
|
|
use PHPUnit\Framework\MockObject\Invocation\StaticInvocation;
|
|
use PHPUnit\Framework\MockObject\Stub\Stub;
|
|
|
|
class EchoExecuteFirstArgumentStub implements Stub {
|
|
public function invoke( Invocation $invocation ) {
|
|
if ( !$invocation instanceof StaticInvocation ) {
|
|
throw new \PHPUnit\Framework\Exception( 'wrong invocation type' );
|
|
}
|
|
if ( !$invocation->arguments ) {
|
|
throw new \PHPUnit\Framework\Exception( 'Method call must have an argument' );
|
|
}
|
|
|
|
return call_user_func( reset( $invocation->arguments ) );
|
|
}
|
|
|
|
public function toString(): string {
|
|
return 'return result of call_user_func on first invocation argument';
|
|
}
|
|
}
|