/**
  * Test that our results can be filtered down to a single author.
  */
 public function testItFiltersToASingleAuthor()
 {
     $authorResults = new Collection(['Steven King' => new Collection(), 'Stephen King' => new Collection()]);
     $actual = $this->resultCleaner->clean('Steven King', $authorResults, true);
     $expected = new Collection(['Steven King' => new Collection()]);
     $this->assertEquals($expected->toArray(), $actual->toArray());
 }
 public function search($name)
 {
     $authors = Cache::rememberForever('google-books-author-search-' . $name, function () use($name) {
         $results = $this->getResults($name);
         start_measure('authorSearchCleaning', 'Cleaning author search results');
         $results = $this->resultsCleaner->clean($name, $results, false);
         stop_measure('authorSearchCleaning');
         return $results;
     });
     return $authors;
 }