function gitium_group_commit_modified_plugins_and_themes($msg_append = '') { global $git; $uncommited_changes = $git->get_local_changes(); $commit_groups = array(); $commits = array(); if (!empty($msg_append)) { $msg_append = "({$msg_append})"; } foreach ($uncommited_changes as $path => $action) { $change = _gitium_module_by_path($path); $change['action'] = $action; $commit_groups[$change['base_path']] = $change; } foreach ($commit_groups as $base_path => $change) { $commit_message = _gitium_format_message($change['name'], $change['version'], "{$change['action']} {$change['type']}"); $commit = _gitium_commit_changes("{$commit_message} {$msg_append}", $base_path, false); if ($commit) { $commits[] = $commit; } } return $commits; }
function test_gitium_module_by_path_case_7() { $path = 'wp-content/plugins/struto-camila/camila.php'; $assert = _gitium_module_by_path($path) == array('base_path' => 'wp-content/plugins/struto-camila', 'type' => 'plugin', 'name' => 'Strutul', 'version' => '3.2.1'); $this->assertTrue($assert); }