mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +00:00
Add tests for git
This commit is contained in:
parent
536906ed46
commit
e6597256a0
|
|
@ -67,6 +67,6 @@ class Branch
|
||||||
*/
|
*/
|
||||||
public function setName(string $name) /* : void */
|
public function setName(string $name) /* : void */
|
||||||
{
|
{
|
||||||
$this->name = escapeshellarg($name);
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,6 +103,7 @@ class Commit
|
||||||
$this->author = new Author();
|
$this->author = new Author();
|
||||||
$this->branch = new Branch();
|
$this->branch = new Branch();
|
||||||
$this->tag = new Tag();
|
$this->tag = new Tag();
|
||||||
|
$this->repository = new Repository(realpath(__DIR__ . '/../../../../../'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ use phpOMS\System\File\PathException;
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
class Git
|
class Git
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ class Repository
|
||||||
public function __construct(string $path)
|
public function __construct(string $path)
|
||||||
{
|
{
|
||||||
$this->setPath($path);
|
$this->setPath($path);
|
||||||
$this->branch = $this->getActiveBranch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -115,15 +114,11 @@ class Repository
|
||||||
*/
|
*/
|
||||||
public function getActiveBranch() : Branch
|
public function getActiveBranch() : Branch
|
||||||
{
|
{
|
||||||
if (!isset($this->branch)) {
|
$branches = $this->getBranches();
|
||||||
$branches = $this->getBranches();
|
$active = preg_grep('/^\*/', $branches);
|
||||||
$active = preg_grep('/^\*/', $branches);
|
reset($active);
|
||||||
reset($active);
|
|
||||||
|
|
||||||
$this->branch = new Branch(current($active));
|
return new Branch(current($active));
|
||||||
}
|
|
||||||
|
|
||||||
return $this->branch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class Tag
|
||||||
*/
|
*/
|
||||||
public function __construct(string $name = '')
|
public function __construct(string $name = '')
|
||||||
{
|
{
|
||||||
$this->name = escapeshellarg($name);
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -75,7 +75,7 @@ class Tag
|
||||||
*/
|
*/
|
||||||
public function setMessage(string $message) /* : void */
|
public function setMessage(string $message) /* : void */
|
||||||
{
|
{
|
||||||
$this->message = escapeshellarg($message);
|
$this->message = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user