예제 #1
0
 public function testEmit()
 {
     $reduce_input = $this->getMock('ReduceInput', array('getKey'));
     $reduce_input->expects($this->any())->method('getKey')->will($this->returnValue('a'));
     CharCounter::emit($reduce_input, 2);
     $this->assertEquals(1, count(CharCounter::$char_count));
     $this->assertEquals(2, CharCounter::$char_count[$reduce_input->getKey()]);
 }
예제 #2
0
 public function execute(ReduceInput $input)
 {
     $this->count = count($input->getList());
     CharCounter::emit($input, $this->count);
 }