Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreklund committed Feb 18, 2024
1 parent ff6b96e commit d28d11f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion tests/CalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function getCalendar()
$config->imdbsite = 'www.imdb.com';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;

return new Calendar($config);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ChartsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function getCharts()
$config->imdbsite = 'www.imdb.com';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;

return new Charts($config);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PersonSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function getimdbpersonsearch()
$config->language = 'en';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;
$config->debug = false;

$imdbsearch = new PersonSearch($config);
Expand Down
2 changes: 1 addition & 1 deletion tests/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ protected function getimdb_person($id = '0594503')
$config->imdbsite = 'www.imdb.com';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;

return new \Imdb\Person($id, $config);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TitleSearchAdvancedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function getTitleSearchAdvanced()
$config->imdbsite = 'www.imdb.com';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;

return new TitleSearchAdvanced($config);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TitleSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected function getimdbsearch()
$config->language = 'en';
$config->cachedir = realpath(dirname(__FILE__) . '/cache') . '/';
$config->usezip = false;
$config->cache_expire = 3600;
$config->cache_expire = 86400;
$config->debug = false;

$imdbsearch = new TitleSearch($config);
Expand Down
36 changes: 18 additions & 18 deletions tests/TitleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function testOrig_title_with_no_original()
public function testOrig_title_with_original()
{
$imdb = $this->getImdb('0087544');
$this->assertEquals('Kaze no tani no Naushika', $imdb->orig_title());
$this->assertEquals('Kaze no Tani no Nausicaä', $imdb->orig_title());
}

public function testYear_for_a_film()
Expand Down Expand Up @@ -356,8 +356,8 @@ public function testVotes()
{
$imdb = $this->getImdb();
$votes = $imdb->votes();
$this->assertGreaterThan(1500000, $votes);
$this->assertLessThan(2000000, $votes);
$this->assertGreaterThan(2000000, $votes);
$this->assertLessThan(3000000, $votes);
}

// public function testVotes_no_votes()
Expand Down Expand Up @@ -439,9 +439,9 @@ public function testKeywords()
{
$imdb = $this->getImdb("0306414");
$keywords = $imdb->keywords();
$this->assertTrue(in_array('corruption', $keywords));
$this->assertTrue(in_array('drug trafficking', $keywords));
$this->assertTrue(in_array('urban decay', $keywords));
$this->assertTrue(in_array('baltimore maryland', $keywords));
$this->assertTrue(in_array('police', $keywords));
}

public function testLanguage()
Expand Down Expand Up @@ -758,9 +758,9 @@ public function testAlsoknow()

$matchNames = [];
foreach ($akas as $aka) {
if ($aka['title'] == 'Kaze no tani no Naushika' && $aka['comment'] == 'original title') {
if ($aka['title'] == 'Kaze no Tani no Nausicaä' && $aka['comment'] == 'original title') {
// Original title
$this->assertEquals('Kaze no tani no Naushika', $aka['title']);
$this->assertEquals('Kaze no Tani no Nausicaä', $aka['title']);
$this->assertEquals(
$aka['comment'],
'original title'
Expand Down Expand Up @@ -1448,8 +1448,8 @@ public function testGoofs()

$goofs = $imdb->goofs();
$this->assertIsArray($goofs);
$this->assertGreaterThan(140, count($goofs));
$this->assertLessThan(170, count($goofs));
$this->assertGreaterThan(40, count($goofs));
$this->assertLessThan(51, count($goofs));

$this->assertEquals('Audio/visual unsynchronised', $goofs[0]['type']);
$this->assertEquals('When Neo meets Trinity for the first time in the nightclub she is close to him talking in his ear. Even though she pauses between sentences the shot from the back of Trinity shows that her jaw is still moving during the pauses.', $goofs[0]['content']);
Expand All @@ -1460,7 +1460,7 @@ public function testQuotes()
$imdb = $this->getImdb();
$quotes = $imdb->quotes();

$this->assertGreaterThan(100, count($quotes));
$this->assertEquals(50, count($quotes));
}

public function testQuotes_split()
Expand Down Expand Up @@ -1488,7 +1488,7 @@ public function testQuotes_split()
array(
'quote' => 'All in the game yo, all in the game.',
'character' => array(
'url' => 'https://www.imdb.com/name/nm0931324/?ref_=tt_trv_qu',
'url' => 'https://www.imdb.com/name/nm0931324/?ref_=ttqu_qu',
'name' => 'Omar'
)
)
Expand Down Expand Up @@ -1543,8 +1543,8 @@ public function testTrivia()
$imdb = $this->getImdb();
$trivia = $imdb->trivia();

$this->assertGreaterThan(100, count($trivia));
$this->assertTrue(in_array('The lobby shootout took ten days to film.', $trivia));
$this->assertEquals(5, count($trivia));
$this->assertTrue(in_array('The opening action scene took six months of training and four days to shoot.', $trivia));
}

public function testTrivia_spoilers()
Expand Down Expand Up @@ -1639,7 +1639,7 @@ public function test_locations()
{
$imdb = $this->getImdb(107290);
$locations = $imdb->locations();
$this->assertGreaterThan(17, $locations);
$this->assertEquals(5, count($locations));

$matches = 0;
foreach ($locations as $location) {
Expand All @@ -1665,7 +1665,7 @@ public function testProdCompany()
$prodCompany = $imdb->prodCompany();
$this->assertEquals('Warner Bros.', $prodCompany[0]['name']);
$this->stringStartsWith('https://www.imdb.com/company/co0002663')->evaluate($prodCompany[0]['url']);
$this->assertEquals('(presents)', $prodCompany[0]['notes']);
$this->assertEquals('(presentation)', $prodCompany[0]['notes']);
}

public function testDistCompany()
Expand Down Expand Up @@ -1714,7 +1714,7 @@ public function testParentalGuide_spoilers()
{
$imdb = $this->getImdb(120737);
$parentalGuide = $imdb->parentalGuide(true);
$violence = $parentalGuide['Frightening'][1];
$violence = $parentalGuide['Frightening'][0];
$this->assertSame(0, strpos($violence, 'Gandalf\'s "death" scene'));
}

Expand All @@ -1735,9 +1735,9 @@ public function testKeywords_all()
{
$imdb = $this->getImdb();
$keywords_all = $imdb->keywords_all();
$this->assertGreaterThan(250, count($keywords_all));
$this->assertEquals(50, count($keywords_all));
$this->assertTrue(in_array('truth', $keywords_all));
$this->assertTrue(in_array('human machine relationship', $keywords_all));
$this->assertTrue(in_array('reference to alice in wonderland', $keywords_all));
}

public function test_title_redirects_are_followed()
Expand Down

0 comments on commit d28d11f

Please sign in to comment.