anchor.diff:    });
   
     group('packages test/pub', () {
  -    MockProcessManager mockProcessManager;
  +    FakeProcessManager processManager;
       FakeStdio mockStdio;
   
       setUp(() {
  -      mockProcessManager = MockProcessManager();
  +      processManager = FakeProcessManager.list(<FakeCommand>[]);
         mockStdio = FakeStdio()..stdout.terminalColumns = 80;
       });
   
       testUsingContext('test without bot', () async {
  +      Cache.flutterRoot = '';
  +      globals.fs.file('pubspec.yaml').createSync();
  +      processManager.addCommand(
  +        const FakeCommand(command: <String>['/bin/cache/dart-sdk/bin/pub', 'run', 'test']),
  +      );
         await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(3));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'run');
  -      expect(commands[2], 'test');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  +
  +      expect(processManager.hasRemainingExpectations, false);
  +    }, overrides: <Type, Generator>{
  +      FileSystem: () => MemoryFileSystem.test(),
  +      Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}),
  +      ProcessManager: () => processManager,
         Stdio: () => mockStdio,
         BotDetector: () => const FakeBotDetector(false),
         Pub: () => Pub(
  
positive.code:     });
  
      testUsingContext('test with bot', () async {
        await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'test']);
        final List<String> commands = mockProcessManager.commands;
        expect(commands, hasLength(4));
        expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
        expect(commands[1], '--trace');
        expect(commands[2], 'run');
        expect(commands[3], 'test');
      }, overrides: <Type, Generator>{
        ProcessManager: () => mockProcessManager,
        Stdio: () => mockStdio,
        BotDetector: () => const FakeBotDetector(true),
        Pub: () => Pub(
  
negative.code:       ),
      });
  
      testUsingContext('run pass arguments through to pub', () async {
        Cache.flutterRoot = '';
        globals.fs.file('pubspec.yaml').createSync();
        final IOSink stdin = IOSink(StreamController<List<int>>().sink);
        processManager.addCommand(
          FakeCommand(command: const <String>[
            '/bin/cache/dart-sdk/bin/pub', 'run', '--foo', 'bar'],
            stdin: stdin,
          ),
        );
        await createTestCommandRunner(PackagesCommand()).run(<String>['packages', '--verbose', 'pub', 'run', '--foo', 'bar']);
  
        expect(processManager.hasRemainingExpectations, false);
      }, overrides: <Type, Generator>{
        FileSystem: () => MemoryFileSystem.test(),
        Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}),
        ProcessManager: () => processManager,
        Stdio: () => mockStdio,
        Pub: () => Pub(
          fileSystem: globals.fs,
          logger: globals.logger,
  