mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
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:
@@ -80,12 +80,17 @@ class InterfaceTest extends WebTestCase
|
|||||||
$repository->checkout("master");
|
$repository->checkout("master");
|
||||||
|
|
||||||
// master-less repository fixture
|
// master-less repository fixture
|
||||||
$git->createRepository(self::$tmpdir . 'masterless');
|
$git->createRepository(self::$tmpdir . 'develop');
|
||||||
$repository = $git->getRepository(self::$tmpdir . 'masterless');
|
$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->createBranch("develop");
|
||||||
$repository = $repository->checkout('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.name', 'Luke Skywalker');
|
||||||
$repository->setConfig('user.email', 'luke@rebel.org');
|
$repository->setConfig('user.email', 'luke@rebel.org');
|
||||||
$repository->addAll();
|
$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->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-header:contains("foobar")'));
|
||||||
$this->assertCount(1, $crawler->filter('div.repository-body:contains("This is a test repo!")'));
|
$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/', $crawler->filter('.repository-header a')->eq(6)->attr('href'));
|
||||||
$this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(5)->attr('href'));
|
$this->assertEquals('/foobar/master/rss/', $crawler->filter('.repository-header a')->eq(7)->attr('href'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRepositoryPage()
|
public function testRepositoryPage()
|
||||||
@@ -252,11 +257,11 @@ class InterfaceTest extends WebTestCase
|
|||||||
$this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent());
|
$this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMasterlessRepo()
|
public function testDevelopRepo()
|
||||||
{
|
{
|
||||||
$client = $this->createClient();
|
$client = $this->createClient();
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/masterless/');
|
$crawler = $client->request('GET', '/develop/');
|
||||||
$this->assertTrue($client->getResponse()->isOk());
|
$this->assertTrue($client->getResponse()->isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user