Change API::getProjectByName() to reflect the documentation
This commit is contained in:
@@ -52,12 +52,12 @@ class Project extends Base
|
|||||||
* Get a project by the name
|
* Get a project by the name
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $project_name Project name
|
* @param string $name Project name
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getByName($project_name)
|
public function getByName($name)
|
||||||
{
|
{
|
||||||
return $this->db->table(self::TABLE)->eq('name', $project_name)->findOne();
|
return $this->db->table(self::TABLE)->eq('name', $name)->findOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -80,6 +80,21 @@ class Api extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(1, $project['id']);
|
$this->assertEquals(1, $project['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetProjectByName()
|
||||||
|
{
|
||||||
|
$project = $this->client->getProjectByName('API test');
|
||||||
|
$this->assertNotEmpty($project);
|
||||||
|
$this->assertEquals(1, $project['id']);
|
||||||
|
|
||||||
|
$project = $this->client->getProjectByName(array('name' => 'API test'));
|
||||||
|
$this->assertNotEmpty($project);
|
||||||
|
$this->assertEquals(1, $project['id']);
|
||||||
|
|
||||||
|
$project = $this->client->getProjectByName('None');
|
||||||
|
$this->assertEmpty($project);
|
||||||
|
$this->assertNull($project);
|
||||||
|
}
|
||||||
|
|
||||||
public function testUpdateProject()
|
public function testUpdateProject()
|
||||||
{
|
{
|
||||||
$project = $this->client->getProjectById(1);
|
$project = $this->client->getProjectById(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user