Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Aug 15, 2015
1 parent 4f043f5 commit 7731c23
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/Packagist/WebBundle/Controller/FeedController.php
Expand Up @@ -199,6 +199,8 @@ protected function buildFeed(Request $req, $title, $description, $url, $items)

if ($feed->count()) {
$feed->setDateModified($feed->getEntry(0)->getDateModified());
} else {
$feed->setDateModified(new \DateTime());
}

return $feed;
Expand Down
Expand Up @@ -11,6 +11,6 @@ public function testPackagist()
$client = self::createClient();

$crawler = $client->request('GET', '/about');
$this->assertEquals('What is Packagist?', $crawler->filter('.box h1')->first()->text());
$this->assertEquals('What is Packagist?', $crawler->filter('h2.title')->first()->text());
}
}
}
Expand Up @@ -21,7 +21,7 @@ public function testFeedAction($feed, $format, $vendor = null)

$crawler = $client->request('GET', $url);

$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode(), $client->getResponse()->getContent());
$this->assertContains($format, $client->getResponse()->getContent());

if ($vendor !== null) {
Expand Down
Expand Up @@ -16,7 +16,7 @@ public function testHomepage()
$client = self::createClient();

$crawler = $client->request('GET', '/');
$this->assertEquals('Getting Started', $crawler->filter('.getting-started h1')->text());
$this->assertEquals('Getting Started', $crawler->filter('.getting-started h2')->text());
}

public function testPackages()
Expand All @@ -32,7 +32,7 @@ public function testPackage()
$client = self::createClient();
//we expect package to be clickable and showing at least 'package' div
$crawler = $client->request('GET', '/packages/');
$link = $crawler->filter('.packages li h1 a')->first()->attr('href');
$link = $crawler->filter('.packages li a')->first()->attr('href');

$crawler = $client->request('GET', $link);
$this->assertTrue($crawler->filter('.package')->count() > 0);
Expand Down

0 comments on commit 7731c23

Please sign in to comment.