From 179aeeff218d505e8e2da6dde0939a95cd11d01e Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Sat, 1 Jun 2013 15:04:35 -0300 Subject: [PATCH] Fixing broken tests --- tests/InterfaceTest.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 43b8391..fecdfed 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -136,15 +136,28 @@ class InterfaceTest extends WebTestCase $this->assertTrue($client->getResponse()->isOk()); $this->assertCount(1, $crawler->filter('title:contains("GitList")')); + $this->assertCount(1, $crawler->filter('div.repository-header a:contains("GitTest")')); $this->assertEquals('/GitTest/', $crawler->filter('.repository-header a')->eq(0)->attr('href')); $this->assertEquals('/GitTest/master/rss/', $crawler->filter('.repository-header a')->eq(1)->attr('href')); - $this->assertEquals('/NestedRepo/', $crawler->filter('.repository-header a')->eq(2)->attr('href')); - $this->assertEquals('/NestedRepo/master/rss/', $crawler->filter('.repository-header a')->eq(3)->attr('href')); + + $this->assertCount(1, $crawler->filter('div.repository-header a:contains("detached-head")')); + $this->assertEquals('/detached-head/', $crawler->filter('.repository-header a')->eq(2)->attr('href')); + $this->assertEquals('/detached-head/master/rss/', $crawler->filter('.repository-header a')->eq(3)->attr('href')); + + $this->assertCount(1, $crawler->filter('div.repository-header a:contains("develop")')); + $this->assertEquals('/develop/', $crawler->filter('.repository-header a')->eq(4)->attr('href')); + $this->assertEquals('/develop/master/rss/', $crawler->filter('.repository-header a')->eq(5)->attr('href')); + $this->assertCount(1, $crawler->filter('div.repository-header:contains("foobar")')); $this->assertCount(1, $crawler->filter('div.repository-body:contains("This is a test repo!")')); - $this->assertEquals('/foobar/', $crawler->filter('.repository-header a')->eq(8)->attr('href')); - $this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(9)->attr('href')); + $this->assertEquals('/foobar/', $crawler->filter('.repository-header a')->eq(6)->attr('href')); + $this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(7)->attr('href')); + + $this->assertCount(1, $crawler->filter('div.repository-header a:contains("nested/NestedRepo")')); + $this->assertEquals('/nested/NestedRepo/', $crawler->filter('.repository-header a')->eq(8)->attr('href')); + $this->assertEquals('/nested/NestedRepo/master/rss/', $crawler->filter('.repository-header a')->eq(9)->attr('href')); + $this->assertCount(1, $crawler->filter('div.repository-body:contains("This is a NESTED test repo!")')); } public function testRepositoryPage() @@ -277,7 +290,7 @@ class InterfaceTest extends WebTestCase { $client = $this->createClient(); - $client->request('GET', '/NestedRepo/'); + $client->request('GET', '/nested/NestedRepo/'); $response = $client->getResponse(); $this->assertTrue($response->isOk()); @@ -296,7 +309,7 @@ class InterfaceTest extends WebTestCase { $client = $this->createClient(); - $crawler = $client->request('GET', '/NestedRepo/testing/'); + $crawler = $client->request('GET', '/nested/NestedRepo/testing/'); $this->assertTrue($client->getResponse()->isOk()); $this->assertRegexp('/NESTED TEST BRANCH README/', $client->getResponse()->getContent()); }