Fix tests (and this time I tested it).

Admittedly, I tested it by modifying composer.json to include phpunit
but then did not commit that change, so it's vaguely possible an older
phpunit would find a way to fail.

I think we should be good, though.
This commit is contained in:
Nate Eagleson
2012-12-20 22:22:47 -05:00
parent 9dfca14f31
commit 1f8f321037

View File

@@ -80,12 +80,17 @@ class InterfaceTest extends WebTestCase
$repository->checkout("master");
// master-less repository fixture
$git->createRepository(self::$tmpdir . 'masterless');
$repository = $git->getRepository(self::$tmpdir . 'masterless');
$git->createRepository(self::$tmpdir . 'develop');
$repository = $git->getRepository(self::$tmpdir . '/develop');
$repository->setConfig('user.name', 'Luke Skywalker');
$repository->setConfig('user.email', 'luke@rebel.org');
file_put_contents(self::$tmpdir . 'develop/README.md', "## develop\ndevelop is a *test* repository!");
$repository->addAll();
$repository->commit("First commit");
$repository->createBranch("develop");
$repository = $repository->checkout('develop');
file_put_contents(self::$tmpdir . 'masterless/README.md', "## masterless\nmasterless is a *test* repository!");
file_put_contents(self::$tmpdir . 'masterless/test.php', "<?php\necho 'Hello World'; // This is a test");
file_put_contents(self::$tmpdir . 'develop/test.php', "<?php\necho 'Hello World'; // This is a test");
$repository->setConfig('user.name', 'Luke Skywalker');
$repository->setConfig('user.email', 'luke@rebel.org');
$repository->addAll();
@@ -121,8 +126,8 @@ class InterfaceTest extends WebTestCase
$this->assertEquals('/nested/NestedRepo/master/rss/', $crawler->filter('.repository-header a')->eq(3)->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(4)->attr('href'));
$this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(5)->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'));
}
public function testRepositoryPage()
@@ -252,11 +257,11 @@ class InterfaceTest extends WebTestCase
$this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent());
}
public function testMasterlessRepo()
public function testDevelopRepo()
{
$client = $this->createClient();
$crawler = $client->request('GET', '/masterless/');
$crawler = $client->request('GET', '/develop/');
$this->assertTrue($client->getResponse()->isOk());
}