Add sequential + test find mode options to frameworks.yaml
[hiphop-php.git] / hphp / test / frameworks / framework_class_overrides / Kohana.php
blobd8664191f9be8310da60e4efbf8a6b8da4c54cdb
1 <?hh
2 require_once __DIR__.'/../Framework.php';
4 class Kohana extends Framework {
5 protected function install(): void {
6 parent::install();
7 $root = nullthrows($this->getInstallRoot());
9 verbose("Initialize submodules.\n");
10 $git_command = "git submodule update --init";
11 $git_ret = run_install($git_command, $root,
12 ProxyInformation::$proxies);
13 if ($git_ret !== 0) {
14 remove_dir_recursive($root);
15 error_and_exit("Could not initialize submodules for ". $this->name.
16 "! Removing framework!\n");
19 verbose("Updating submodule branches.\n");
20 // Manually checkout release appropriate system branch
21 // See: https://github.com/kohana/kohana/wiki/developers
22 $git_command = 'git submodule foreach "';
23 $git_command .= 'git fetch && git checkout';
24 $git_command .= ' '.$this->getGitBranch().'"';
25 $git_ret = run_install($git_command, $root,
26 ProxyInformation::$proxies);
27 if ($git_ret !== 0) {
28 remove_dir_recursive($root);
29 error_and_exit("Could not checkout submodule branch for ". $this->name.
30 "! Removing framework!\n");
33 verbose("Creating a phpunit.xml for running the Kohana tests.\n");
34 $phpunit_xml = <<<XML
35 <phpunit bootstrap="./modules/unittest/bootstrap_all_modules.php">
36 <testsuites>
37 <testsuite name="Kohana">
38 <directory>./system</directory>
39 <directory>./modules</directory>
40 </testsuite>
41 </testsuites>
42 </phpunit>
43 XML;
44 file_put_contents($this->getTestPath()."/phpunit.xml", $phpunit_xml);
47 protected function isInstalled(): bool {
48 $extra_files = Set {
49 $this->getTestPath()."/phpunit.xml",
51 $root = nullthrows($this->getInstallRoot());
53 if (file_exists($root)) {
54 foreach ($extra_files as $file) {
55 if (!file_exists($file)) {
56 remove_dir_recursive($root);
57 return false;
61 return parent::isInstalled();