mockStdinText = $stdin; } public function getStdin( $len = null ) { if ( $len !== null ) { throw new ExpectationFailedException( "Tried to get stdin with non null parameter" ); } return fopen( 'data://text/plain,' . $this->mockStdinText, 'r' ); } } /** * @covers \FindClasses * @group Database * @author Dreamy Jazz */ class FindClassesTest extends MaintenanceBaseTestCase { protected function getMaintenanceClass() { return SemiMockedFindClasses::class; } public function testExecute() { $this->maintenance->mockStdin( "MediaWiki\Maintenance\Version\n" ); $this->maintenance->execute(); $this->expectOutputString( MW_INSTALL_PATH . "/maintenance/Version.php\n" ); } }