/**
  * @inheritdoc
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->input = $input;
     $this->output = $output;
     $passwd = new Passwd();
     $users = $passwd->getUsersByGroup($input->getOption("group"));
     $pools = $this->divideUsersIntoPools($users);
     $fork = new duncan3dc\Helpers\Fork();
     foreach ($pools as $pool) {
         $fork->call(function () use($pool) {
             foreach ($pool as $user) {
                 $this->indexFilesForUser($user);
             }
         });
     }
     $fork->wait();
 }
示例#2
0
 /**
  * @depends testGetUserByUsername
  */
 public function testGetUsersInGroup()
 {
     $passwd = new Passwd($this->passwd, $this->group);
     $users = $passwd->getUsersByGroup("bin");
     $expected = [$passwd->getUserByUsername("root"), $passwd->getUserByUsername("bin"), $passwd->getUserByUsername("daemon")];
     $this->assertEquals($expected, $users);
 }