This repository was archived by the owner on Dec 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +40
-9
lines changed
Resources/config/doctrine Expand file tree Collapse file tree 5 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,21 @@ public function load(ObjectManager $manager)
83
83
84
84
$ manager ->persist ($ tweet );
85
85
$ manager ->flush ();
86
+
87
+ // 280 characters
88
+ $ tweet = new Tweet ();
89
+ $ tweet
90
+ ->setId (928032273747795968 )
91
+ ->setUser ($ this ->getReference ('user ' ))
92
+ ->setCreatedAt (new \Datetime ('2017-11-08 21:20:00 ' ))
93
+ ->setText ('In the criminal justice system, sexually based offenses are considered especially heinous. ' .
94
+ 'In New York City, the dedicated detectives who investigate these vicious felonies are members of ' .
95
+ 'an elite squad known as the Special Victims Unit. These are their stories. *DUN DUN*️ ' )
96
+ ->setRetweetCount (144416 )
97
+ ->setFavoriteCount (256453 );
98
+
99
+ $ manager ->persist ($ tweet );
100
+ $ manager ->flush ();
86
101
}
87
102
88
103
/**
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public function load(ObjectManager $manager)
38
38
39
39
$ this ->addReference ('user-github ' , $ user );
40
40
41
- // Use whose tweet is retweeted
41
+ // User whose tweet is retweeted
42
42
$ user = new User ();
43
43
$ user
44
44
->setId (131295561 )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet:
19
19
length : null
20
20
text :
21
21
type : string
22
- length : ' 255 '
22
+ length : ' 280 '
23
23
retweet_count :
24
24
type : integer
25
25
length : null
Original file line number Diff line number Diff line change @@ -255,6 +255,12 @@ public function testStatusesHomeTimelineWithTweetAndRetweet()
255
255
);
256
256
}
257
257
258
+ /**
259
+ * @requires OS Linux
260
+ *
261
+ * It returns “last tweet = 928032273747800064” on Windows (AppVeyor),
262
+ * this is equal to 928032273747795968+4096, it looks like a bug on Windows.
263
+ */
258
264
public function testStatusesHomeTimelineWithSinceIdParameter ()
259
265
{
260
266
$ this ->loadFixtures ([
@@ -264,12 +270,6 @@ public function testStatusesHomeTimelineWithSinceIdParameter()
264
270
// Disable decoration for tests on Windows
265
271
$ options = [];
266
272
267
- // http://stackoverflow.com/questions/5879043/php-script-detect-whether-running-under-linux-or-windows/5879078#5879078
268
- if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'WIN ' ) {
269
- // https://tracker.phpbb.com/browse/PHPBB3-12752
270
- $ options ['decorated ' ] = false ;
271
- }
272
-
273
273
$ this ->commandTester ->execute (
274
274
['test ' => 'empty_array ' ],
275
275
$ options
@@ -278,7 +278,7 @@ public function testStatusesHomeTimelineWithSinceIdParameter()
278
278
$ display = $ this ->commandTester ->getDisplay ();
279
279
280
280
$ this ->assertContains (
281
- 'last tweet = 1005868490 ' ,
281
+ 'last tweet = 928032273747795968 ' ,
282
282
$ display
283
283
);
284
284
}
Original file line number Diff line number Diff line change @@ -49,4 +49,20 @@ public function testTweetRepository()
49
49
50
50
$ this ->assertEquals (3 , $ tweets );
51
51
}
52
+
53
+ public function testTweetRepositoryWithLongTweet ()
54
+ {
55
+ $ this ->loadFixtures ([
56
+ 'AlexisLefebvre\Bundle\AsyncTweetsBundle\DataFixtures\ORM\LoadTweetData ' ,
57
+ ]);
58
+
59
+ /** @var Tweet $tweet */
60
+ $ tweet = $ this ->em
61
+ ->getRepository ('AsyncTweetsBundle:Tweet ' )
62
+ ->findOneBy (['id ' => 928032273747795968 ]);
63
+
64
+ $ this ->assertNotNull ($ tweet );
65
+
66
+ $ this ->assertSame (275 , strlen ($ tweet ->getText ()));
67
+ }
52
68
}
You can’t perform that action at this time.
0 commit comments