From 2b43be92b3c7fccbba780f34348ece41f874d27e Mon Sep 17 00:00:00 2001 From: Christian Schorn Date: Wed, 31 Oct 2012 19:09:29 +0100 Subject: [PATCH] Add unit tests for nested repository --- tests/InterfaceTest.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index 244e9b7..d475158 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -72,6 +72,13 @@ class InterfaceTest extends WebTestCase $repository->setConfig('user.email', 'luke@rebel.org'); $repository->addAll(); $repository->commit("First commit"); + $repository->createBranch("testing"); + $repository->checkout("testing"); + file_put_contents($nested_dir . 'NestedRepo/README.txt', 'NESTED TEST BRANCH README'); + $repository->addAll(); + $repository->commit("Changing branch"); + $repository->checkout("master"); + } public function createApplication() @@ -225,6 +232,24 @@ class InterfaceTest extends WebTestCase $this->assertRegexp('/Initial commit/', $client->getResponse()->getContent()); } + public function testNestedRepoPage() + { + $client = $this->createClient(); + + $crawler = $client->request('GET', '/nested/NestedRepo/'); + $this->assertTrue($client->getResponse()->isOk()); + $this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent()); + } + + public function testNestedRepoBranch() + { + $client = $this->createClient(); + + $crawler = $client->request('GET', '/nested/NestedRepo/testing/'); + $this->assertTrue($client->getResponse()->isOk()); + $this->assertRegexp('/NESTED TEST BRANCH README/', $client->getResponse()->getContent()); + } + public static function tearDownAfterClass() { $fs = new Filesystem();