Skip to content
This repository was archived by the owner on Dec 14, 2024. It is now read-only.

Commit 83ec372

Browse files
Merge pull request #87 from alexislefebvre/analysis-1bx2x5
Apply fixes from StyleCI
2 parents c2c60ed + 3c42084 commit 83ec372

File tree

6 files changed

+50
-28
lines changed

6 files changed

+50
-28
lines changed

tests/Command/StatusesHomeTimelineTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class StatusesHomeTimelineTest extends StatusesBase
1313
{
1414
use FixturesTrait;
1515

16-
/** @var CommandTester $commandTester */
16+
/** @var CommandTester */
1717
public $commandTester;
1818

1919
public function setUp(): void

tests/Command/StatusesHomeTimelineTestCommand.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ protected function getContent(InputInterface $input)
4646
switch ($input->getArgument('test')) {
4747
case 'json':
4848
return $this->getTestContent(
49-
'tweets_32_bits.json');
49+
'tweets_32_bits.json'
50+
);
5051
case 'json_with_retweet':
5152
return $this->getTestContent(
52-
'tweet_with_retweet.json');
53+
'tweet_with_retweet.json'
54+
);
5355
case 'not_array':
5456
// Return null instead of JSON
5557
return;

tests/Command/StatusesReadTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class StatusesReadTest extends StatusesBase
1010
{
1111
use FixturesTrait;
1212

13-
/** @var CommandTester $commandTester */
13+
/** @var CommandTester */
1414
public $commandTester;
1515

1616
public function setUp(): void

tests/Controller/DefaultControllerTest.php

+38-20
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ public function testNoTweets()
2525
$crawler = $this->testClient->request('GET', $path);
2626

2727
// <body>
28-
$this->assertSame(1,
29-
$crawler->filter('html > body')->count());
28+
$this->assertSame(
29+
1,
30+
$crawler->filter('html > body')->count()
31+
);
3032

3133
// Tweet
32-
$this->assertSame(0,
34+
$this->assertSame(
35+
0,
3336
$crawler->filter(
3437
'main.container > div.tweets > div.media > blockquote.media-body'
35-
)->count());
38+
)->count()
39+
);
3640
}
3741

3842
public function testTweets($path = null)
@@ -52,8 +56,10 @@ public function testTweets($path = null)
5256
$this->assertStatusCode(200, $this->testClient);
5357

5458
if ($profile = $this->testClient->getProfile()) {
55-
$this->assertSame(5,
56-
$profile->getCollector('db')->getQueryCount());
59+
$this->assertSame(
60+
5,
61+
$profile->getCollector('db')->getQueryCount()
62+
);
5763
} else {
5864
$this->markTestIncomplete(
5965
'Profiler is disabled.'
@@ -106,7 +112,8 @@ public function testTweets($path = null)
106112
$this->assertSame(
107113
4,
108114
$crawler->filter(
109-
'blockquote.media-body > p')->count()
115+
'blockquote.media-body > p'
116+
)->count()
110117
);
111118

112119
// User
@@ -157,8 +164,10 @@ public function testTweetsPages()
157164
$this->assertStatusCode(200, $this->testClient);
158165

159166
if ($profile = $this->testClient->getProfile()) {
160-
$this->assertSame(4,
161-
$profile->getCollector('db')->getQueryCount());
167+
$this->assertSame(
168+
4,
169+
$profile->getCollector('db')->getQueryCount()
170+
);
162171
} else {
163172
$this->markTestIncomplete(
164173
'Profiler is disabled.'
@@ -182,7 +191,8 @@ public function testTweetsPages()
182191
$this->assertSame(
183192
5,
184193
$crawler->filter(
185-
'blockquote.media-body > p')->count()
194+
'blockquote.media-body > p'
195+
)->count()
186196
);
187197

188198
// User
@@ -211,7 +221,7 @@ public function testTweetsPages()
211221
$crawler->filter(
212222
'main.container > div.tweets > div.media > blockquote.media-body'
213223
)->count()
214-
);
224+
);
215225

216226
// Next page
217227
$crawler = $this->testClient->request('GET', $nextPage);
@@ -238,7 +248,7 @@ public function testTweetsPages()
238248
$link = $crawler->filter(
239249
'main.container > div.tweets > div.media > '.
240250
'blockquote.media-body > small > a:last-child'
241-
)
251+
)
242252
->eq(4)->link();
243253

244254
$crawler = $this->testClient->click($link);
@@ -309,8 +319,10 @@ public function testCookie()
309319
$this->assertStatusCode(200, $this->testClient);
310320

311321
if ($profile = $this->testClient->getProfile()) {
312-
$this->assertSame(5,
313-
$profile->getCollector('db')->getQueryCount());
322+
$this->assertSame(
323+
5,
324+
$profile->getCollector('db')->getQueryCount()
325+
);
314326
} else {
315327
$this->markTestIncomplete(
316328
'Profiler is disabled.'
@@ -433,8 +445,10 @@ public function testDeleteTweets()
433445
$this->assertStatusCode(200, $this->testClient);
434446

435447
if ($profile = $this->testClient->getProfile()) {
436-
$this->assertSame(4,
437-
$profile->getCollector('db')->getQueryCount());
448+
$this->assertSame(
449+
4,
450+
$profile->getCollector('db')->getQueryCount()
451+
);
438452
} else {
439453
$this->markTestIncomplete(
440454
'Profiler is disabled.'
@@ -514,9 +528,11 @@ public function testDeleteTweets()
514528
$crawler = $this->testClient->click($link);
515529

516530
// Image
517-
$this->assertSame(1,
531+
$this->assertSame(
532+
1,
518533
$crawler->filter('main.container > div.tweets blockquote.media-body > '.
519-
'p > a > img')->count());
534+
'p > a > img')->count()
535+
);
520536

521537
// Delete the second Tweet in order to remove all the Media
522538

@@ -650,8 +666,10 @@ public function testHideRetweetedTweets()
650666
$this->assertStatusCode(200, $this->testClient);
651667

652668
if ($profile = $this->testClient->getProfile()) {
653-
$this->assertSame(4,
654-
$profile->getCollector('db')->getQueryCount());
669+
$this->assertSame(
670+
4,
671+
$profile->getCollector('db')->getQueryCount()
672+
);
655673
} else {
656674
$this->markTestIncomplete(
657675
'Profiler is disabled.'

tests/DataFixtures/ORM/LoadTweetPagesData.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public function load(ObjectManager $manager)
2222
->setId($tweetId)
2323
->setUser($this->getReference('user-githubeng'))
2424
->setCreatedAt(new \Datetime(
25-
'2015-02-10 21:18:'.sprintf('%02d', $tweetId)))
25+
'2015-02-10 21:18:'.sprintf('%02d', $tweetId)
26+
))
2627
->setText($tweetId)
2728
->setRetweetCount($tweetId)
2829
->setFavoriteCount($tweetId);
@@ -36,7 +37,8 @@ public function load(ObjectManager $manager)
3637
->setId($tweetId)
3738
->setUser($this->getReference('user'))
3839
->setCreatedAt(
39-
new \Datetime('2015-02-10 21:19:'.sprintf('%02d', $tweetId)))
40+
new \Datetime('2015-02-10 21:19:'.sprintf('%02d', $tweetId))
41+
)
4042
->setText($tweetId)
4143
->setRetweetCount($tweetId)
4244
->setFavoriteCount($tweetId)

tests/Features/Context/FeatureContext.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
class FeatureContext implements Context
99
{
10-
/** @var $now \Datetime */
10+
/** @var \Datetime */
1111
private $now;
12-
/** @var $tweet \AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet */
12+
/** @var \AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet */
1313
private $tweet;
1414

1515
/**

0 commit comments

Comments
 (0)