Skip to content

Commit 6215bab

Browse files
committed
Converting Codestyle to PSR12
1 parent 7649a8d commit 6215bab

File tree

114 files changed

+19502
-19608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+19502
-19608
lines changed

Tests/GithubObjectTest.php

Lines changed: 118 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -16,134 +16,134 @@
1616
*/
1717
class GithubObjectTest extends GitHubTestCase
1818
{
19-
/**
20-
* @var ObjectMock Object under test.
21-
* @since 1.0
22-
*/
23-
protected $object;
19+
/**
20+
* @var ObjectMock Object under test.
21+
* @since 1.0
22+
*/
23+
protected $object;
2424

25-
/**
26-
* Sets up the fixture, for example, opens a network connection.
27-
* This method is called before a test is executed.
28-
*
29-
* @return void
30-
*
31-
* @since 1.0
32-
*/
33-
protected function setUp(): void
34-
{
35-
parent::setUp();
25+
/**
26+
* Sets up the fixture, for example, opens a network connection.
27+
* This method is called before a test is executed.
28+
*
29+
* @return void
30+
*
31+
* @since 1.0
32+
*/
33+
protected function setUp(): void
34+
{
35+
parent::setUp();
3636

37-
$this->object = new ObjectMock($this->options, $this->client);
38-
}
37+
$this->object = new ObjectMock($this->options, $this->client);
38+
}
3939

40-
/**
41-
* Data provider method for the fetchUrl method tests.
42-
*
43-
* @return array
44-
*
45-
* @since 1.0
46-
*/
47-
public function fetchUrlData()
48-
{
49-
return array(
50-
'Standard github - no pagination data' => array(
51-
'https://api.github.com',
52-
'/gists',
53-
0,
54-
0,
55-
'https://api.github.com/gists'
56-
),
57-
'Enterprise github - no pagination data' => array(
58-
'https://mygithub.com',
59-
'/gists',
60-
0,
61-
0,
62-
'https://mygithub.com/gists'
63-
),
64-
'Standard github - page 3' => array(
65-
'https://api.github.com',
66-
'/gists',
67-
3,
68-
0,
69-
'https://api.github.com/gists?page=3'
70-
),
71-
'Enterprise github - page 3, 50 per page' => array(
72-
'https://mygithub.com',
73-
'/gists',
74-
3,
75-
50,
76-
'https://mygithub.com/gists?page=3&per_page=50'
77-
),
78-
);
79-
}
40+
/**
41+
* Data provider method for the fetchUrl method tests.
42+
*
43+
* @return array
44+
*
45+
* @since 1.0
46+
*/
47+
public function fetchUrlData()
48+
{
49+
return [
50+
'Standard github - no pagination data' => [
51+
'https://api.github.com',
52+
'/gists',
53+
0,
54+
0,
55+
'https://api.github.com/gists',
56+
],
57+
'Enterprise github - no pagination data' => [
58+
'https://mygithub.com',
59+
'/gists',
60+
0,
61+
0,
62+
'https://mygithub.com/gists',
63+
],
64+
'Standard github - page 3' => [
65+
'https://api.github.com',
66+
'/gists',
67+
3,
68+
0,
69+
'https://api.github.com/gists?page=3',
70+
],
71+
'Enterprise github - page 3, 50 per page' => [
72+
'https://mygithub.com',
73+
'/gists',
74+
3,
75+
50,
76+
'https://mygithub.com/gists?page=3&per_page=50',
77+
],
78+
];
79+
}
8080

81-
/**
82-
* Tests the fetchUrl method
83-
*
84-
* @param string $apiUrl @todo
85-
* @param string $path @todo
86-
* @param integer $page @todo
87-
* @param integer $limit @todo
88-
* @param string $expected @todo
89-
*
90-
* @return void
91-
*
92-
* @since 1.0
93-
* @dataProvider fetchUrlData
94-
*/
95-
public function testFetchUrl($apiUrl, $path, $page, $limit, $expected)
96-
{
97-
$this->options->set('api.url', $apiUrl);
81+
/**
82+
* Tests the fetchUrl method
83+
*
84+
* @param string $apiUrl @todo
85+
* @param string $path @todo
86+
* @param integer $page @todo
87+
* @param integer $limit @todo
88+
* @param string $expected @todo
89+
*
90+
* @return void
91+
*
92+
* @since 1.0
93+
* @dataProvider fetchUrlData
94+
*/
95+
public function testFetchUrl($apiUrl, $path, $page, $limit, $expected)
96+
{
97+
$this->options->set('api.url', $apiUrl);
9898

99-
$this->assertThat(
100-
$this->object->fetchUrl($path, $page, $limit),
101-
$this->equalTo($expected)
102-
);
103-
}
99+
$this->assertThat(
100+
$this->object->fetchUrl($path, $page, $limit),
101+
$this->equalTo($expected)
102+
);
103+
}
104104

105-
/**
106-
* Tests the fetchUrl method with basic authentication data
107-
*
108-
* @return void
109-
*
110-
* @since 1.0
111-
*/
112-
public function testFetchUrlBasicAuth()
113-
{
114-
$this->options->set('api.url', 'https://api.github.com');
105+
/**
106+
* Tests the fetchUrl method with basic authentication data
107+
*
108+
* @return void
109+
*
110+
* @since 1.0
111+
*/
112+
public function testFetchUrlBasicAuth()
113+
{
114+
$this->options->set('api.url', 'https://api.github.com');
115115

116-
$this->options->set('api.username', 'MyTestUser');
117-
$this->options->set('api.password', 'MyTestPass');
116+
$this->options->set('api.username', 'MyTestUser');
117+
$this->options->set('api.password', 'MyTestPass');
118118

119-
$this->assertThat(
120-
$this->object->fetchUrl('/gists', 0, 0),
121-
$this->equalTo('https://MyTestUser:MyTestPass@api.github.com/gists'),
122-
'URL is not as expected.'
123-
);
124-
}
119+
$this->assertThat(
120+
$this->object->fetchUrl('/gists', 0, 0),
121+
$this->equalTo('https://MyTestUser:MyTestPass@api.github.com/gists'),
122+
'URL is not as expected.'
123+
);
124+
}
125125

126-
/**
127-
* Tests the fetchUrl method using an oAuth token.
128-
*
129-
* @return void
130-
*/
131-
public function testFetchUrlToken()
132-
{
133-
$this->options->set('api.url', 'https://api.github.com');
126+
/**
127+
* Tests the fetchUrl method using an oAuth token.
128+
*
129+
* @return void
130+
*/
131+
public function testFetchUrlToken()
132+
{
133+
$this->options->set('api.url', 'https://api.github.com');
134134

135-
$this->options->set('gh.token', 'MyTestToken');
135+
$this->options->set('gh.token', 'MyTestToken');
136136

137-
$this->assertThat(
138-
(string) $this->object->fetchUrl('/gists', 0, 0),
139-
$this->equalTo('https://api.github.com/gists'),
140-
'URL is not as expected.'
141-
);
137+
$this->assertThat(
138+
(string) $this->object->fetchUrl('/gists', 0, 0),
139+
$this->equalTo('https://api.github.com/gists'),
140+
'URL is not as expected.'
141+
);
142142

143-
$this->assertThat(
144-
$this->client->getOption('headers'),
145-
$this->equalTo(['Authorization' => 'token MyTestToken']),
146-
'Token should be propagated as a header.'
147-
);
148-
}
143+
$this->assertThat(
144+
$this->client->getOption('headers'),
145+
$this->equalTo(['Authorization' => 'token MyTestToken']),
146+
'Token should be propagated as a header.'
147+
);
148+
}
149149
}

0 commit comments

Comments
 (0)