activatePlugin('scmbzr'); $this->populateStandardTemplate('empty'); $this->init(); $this->open(ROOT); $this->clickAndWait("link=ProjectA"); $this->clickAndWait("link=Admin"); $this->clickAndWait("link=Tools"); $this->clickAndWait("link=Source Code Admin"); $this->click("//input[@name='scmradio' and @value='scmbzr']"); $this->clickAndWait("submit"); // Run the cronjob to create repositories $this->cron("create_scm_repos.php"); // Check that the repo is present and Loggerhead shows it (even if empty) $this->open(ROOT); $this->clickAndWait("link=ProjectA"); $this->clickAndWait("link=SCM"); $this->open(ROOT.'/scm/loggerhead/'); $this->assertTextPresent("Browsing (root)"); $this->clickAndWait("link=projecta"); $this->assertTextPresent("Browsing (root)/projecta"); // Get the address of the repo $this->open(ROOT); $this->clickAndWait("link=ProjectA"); $this->clickAndWait("link=SCM"); $p = $this->getText("//tt[contains(.,'bzr checkout bzr+ssh')]"); $p = preg_replace(",^bzr checkout ,", "", $p); $p = preg_replace(",://.*@,", "://root@", $p); $p = preg_replace(",/branchname$,", "", $p); // Create a local branch, push it to the repo $t = system("mktemp -d /tmp/bzrTest.XXXXXX"); system("cd $t && bzr init trunk >/dev/null", $ret); $this->assertEquals($ret, 0); system("echo 'this is a simple text' > $t/trunk/mytext.txt"); system("cd $t/trunk && bzr add && bzr commit -m'Adding file'", $ret); system("echo 'another simple text' >> $t/trunk/mytext.txt"); system("cd $t/trunk && bzr add && bzr commit -m'Modifying file'", $ret); $this->assertEquals($ret, 0); system("cd $t/trunk && bzr push $p/trunk", $ret); $this->assertEquals($ret, 0); $this->open(ROOT.'/scm/loggerhead/projecta'); $this->assertTextPresent("Browsing (root)/projecta"); $this->assertTextPresent("trunk"); $this->clickAndWait("link=trunk"); $this->assertTextPresent("Modifying file"); $this->assertTextNotPresent("Adding file"); $this->clickAndWait("link=Changes"); $this->assertTextPresent("Modifying file"); $this->assertTextPresent("Adding file"); system("rm -fr $t"); } } ?>