/**
  * @test
  */
 public function testSearchWithNotEmptyQuery()
 {
     $query = 'Name';
     $expectedDiamanteUsers = 1;
     $expectedOroUsers = 3;
     $totalExpectedResult = $expectedDiamanteUsers + $expectedOroUsers;
     $this->userService->expects($this->once())->method('getGravatarLink')->with($this->equalTo('*****@*****.**', DiamanteUserSearchHandler::AVATAR_SIZE));
     $this->diamanteUserRepository->expects($this->once())->method('searchByInput')->with($this->equalTo($query), $this->equalTo($this->getProperties()))->will($this->returnValue($this->getDiamanteUsersCollection($expectedDiamanteUsers, $query)));
     $this->userSearchHandler->expects($this->once())->method('search')->with($this->equalTo($query), 1, 10)->will($this->returnValue(array('results' => $this->getOroUsersCollection($expectedOroUsers, $query), 'more' => false)));
     $result = $this->diamanteUserSearchHandler->search($query, 1, 10);
     $this->assertInternalType('array', $result);
     $this->assertTrue(array_key_exists('results', $result));
     $this->assertEquals($totalExpectedResult, count($result['results']));
     foreach ($result['results'] as $item) {
         $this->assertStringEndsWith($query, $item['firstName']);
     }
 }