diff --git a/src/Packagist/WebBundle/Controller/FeedController.php b/src/Packagist/WebBundle/Controller/FeedController.php index 4622a4baf..3c462a56d 100644 --- a/src/Packagist/WebBundle/Controller/FeedController.php +++ b/src/Packagist/WebBundle/Controller/FeedController.php @@ -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; diff --git a/src/Packagist/WebBundle/Tests/Controller/AboutControllerTest.php b/src/Packagist/WebBundle/Tests/Controller/AboutControllerTest.php index 6fde45024..642f87159 100644 --- a/src/Packagist/WebBundle/Tests/Controller/AboutControllerTest.php +++ b/src/Packagist/WebBundle/Tests/Controller/AboutControllerTest.php @@ -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()); } -} \ No newline at end of file +} diff --git a/src/Packagist/WebBundle/Tests/Controller/FeedControllerTest.php b/src/Packagist/WebBundle/Tests/Controller/FeedControllerTest.php index f9bdf52ce..76e6969e7 100644 --- a/src/Packagist/WebBundle/Tests/Controller/FeedControllerTest.php +++ b/src/Packagist/WebBundle/Tests/Controller/FeedControllerTest.php @@ -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) { diff --git a/src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php b/src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php index 7926a4a8a..968e9ece5 100644 --- a/src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php +++ b/src/Packagist/WebBundle/Tests/Controller/WebControllerTest.php @@ -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() @@ -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);