Repository navigation
Expand file tree
/
Copy pathProjectsTest.php
More file actions
76 lines (62 loc) · 1.69 KB
/
Copy pathProjectsTest.php
File metadata and controls
76 lines (62 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace Github\Tests\Api\Project;
use Github\Api\Project\AbstractProjectApi;
use Github\Tests\Api\TestCase;
class ProjectsTest extends TestCase
{
/**
* @test
*/
public function shouldShowProject()
{
$expectedValue = ['name' => 'Test project 1'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/projects/123')
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->show(123));
}
/**
* @test
*/
public function shouldUpdateProject()
{
$expectedValue = ['project1data'];
$data = ['name' => 'Project 1 update'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('patch')
->with('/projects/123', $data)
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->update(123, $data));
}
/**
* @test
*/
public function shouldRemoveProject()
{
$expectedValue = ['someOutput'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('delete')
->with('/projects/123')
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->deleteProject(123));
}
/**
* @test
*/
public function shouldGetColumnsApiObject()
{
$api = $this->getApiMock();
$this->assertInstanceOf('Github\Api\Project\Columns', $api->columns());
}
/**
* @return string
*/
protected function getApiClass()
{
return AbstractProjectApi::class;
}
}