public function itGetsTheMaxVersionDirectlyFromTheRemote() { $version_list = array('cef75eb766883a62700306de0e57a14b54aa72ec refs/tags/4.0.2', 'e0f6385781c8456e3b920284734786c5af2b7f12 refs/tags/4.01.0', 'e0f6385781c8456e3b920284734786c5af2b7f12 refs/tags/4.1', 'e0f6385781c8456e3b920284734786c5af2b7f12 refs/tags/4.9', 'e0f6385781c8456e3b920284734786c5af2b7f12 refs/tags/4.10'); $gitExec = new MockGitExec(); $gitExec->setReturnValue('lsRemote', $version_list, array('origin')); $git_tag_finder = new LastReleaseFinder($gitExec); $this->assertEqual('4.10', $git_tag_finder->retrieveFrom('origin')); }
* (at your option) any later version. * * Tuleap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap. If not, see <http://www.gnu.org/licenses/>. */ function getSystemOutput($cmd) { $result; exec($cmd, $result); return $result; } function getCandidatePaths() { echo "Please check documentation/cli and documentation/user_guide manually!!" . PHP_EOL; $plugins = getSystemOutput('find plugins -mindepth 1 -maxdepth 1 -type d'); $themes = getSystemOutput('find src/www/themes -mindepth 1 -maxdepth 1 -type d ! -path *common'); $other_paths = array('cli', 'src/www/soap'); return array_merge($other_paths, $plugins, $themes); } require_once 'CheckReleaseGit.class.php'; require_once 'GitExec.class.php'; $git_exec = new GitExec(); $tagFinder = new LastReleaseFinder($git_exec); $last_release_number = $tagFinder->retrieveFrom('stable'); $check_release_reporter = new CheckReleaseReporter(new NonIncrementedPathFinder($git_exec, $last_release_number, new ChangeDetector($git_exec, getCandidatePaths()))); $check_release_reporter->reportViolations();