Fixing some issues with project default branches, adding tests for that too
This commit is contained in:
parent
2bff0270cf
commit
cb53ec9c6d
6 changed files with 111 additions and 9 deletions
78
Tests/PHPCI/Model/ProjectTest.php
Normal file
78
Tests/PHPCI/Model/ProjectTest.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCI\Model\Tests;
|
||||
|
||||
use PHPCI\Model\Project;
|
||||
|
||||
/**
|
||||
* Unit tests for the ProjectService class.
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class ProjectTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_TestGitDefaultBranch()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('git');
|
||||
|
||||
$this->assertEquals('master', $project->getBranch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_TestGithubDefaultBranch()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('github');
|
||||
|
||||
$this->assertEquals('master', $project->getBranch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_TestGitlabDefaultBranch()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('gitlab');
|
||||
|
||||
$this->assertEquals('master', $project->getBranch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_TestBitbucketDefaultBranch()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('bitbucket');
|
||||
|
||||
$this->assertEquals('master', $project->getBranch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_TestMercurialDefaultBranch()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('hg');
|
||||
|
||||
$this->assertEquals('default', $project->getBranch());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue