示例#1
0
 /**
  * @depends initialize
  */
 public function testMapReduceUpdate($pk)
 {
     $this->sut->execute();
     $user = $this->repository->findByPk($pk);
     $this->assertEquals(3, $user->getProfile()->publishingCounter, "3 publish for kirk user");
     $this->assertEquals(3, $user->getProfile()->commentaryCounter, 'kirk user comments its own publish');
     $this->assertEquals(12, $user->getProfile()->likeCounter, "others like kirk's publish and kirk's comment");
     return $pk;
 }
示例#2
0
 public function testMapReduceUpdate()
 {
     $this->sut->execute();
     $listing = $this->repository->find();
     $this->assertCount(3, $listing);
     foreach ($listing as $doc) {
         // all publishing, including the source are updated :
         $this->assertEquals(2, $doc->getRepeatedCount(), get_class($doc));
     }
 }