private static function parseCharacters(Crawler $item)
 {
     $cast = new Cast();
     if (preg_match('/character\\/(.*?)\\/.*$/', $item->filter('a')->attr('href'), $characterIds)) {
         $cast->setId($characterIds[1]);
     }
     $cast->setName($item->filter('a')->eq(1)->text());
     $imageUrl = $item->filter('img')->attr('data-src');
     $imageUrl = preg_replace('/\\/r\\/.*?x.*?\\//', '/', $imageUrl);
     $imageUrl = preg_replace('/\\?s=.*$/', '', $imageUrl);
     $cast->setImage($imageUrl);
     $cast->setRole($item->filter('small')->text());
     foreach ($item->filter('table[class="space_table"] tr') as $actorItem) {
         $actor = new Actor();
         $crawler = new Crawler($actorItem);
         if ($crawler->filter('td')->count() > 1) {
             if (preg_match('/people\\/(.*?)\\/.*$/', $crawler->filter('a')->attr('href'), $actorIds)) {
                 $actor->setId($actorIds[1]);
             }
             $actor->setName($crawler->filter('a')->text());
             $actor->setLanguage($crawler->filter('small')->last()->text());
             $imageUrl = $item->filter('img')->last()->attr('data-src');
             $imageUrl = preg_replace('/\\/r\\/.*?x.*?\\//', '/', $imageUrl);
             $imageUrl = preg_replace('/\\?s=.*$/', '', $imageUrl);
             $actor->setImage($imageUrl);
             $cast->setActors($actor);
         }
     }
     return $cast;
 }
 public function testRole()
 {
     $castRole = 'Main';
     $cast = new Cast();
     $cast->setRole($castRole);
     $this->assertEquals($castRole, $cast->getRole());
 }