/** * @test * * @group entity * @group post-entity */ public function assertFeedTitleIsShortenedProperlyWhenLastCharIsSpace() { $user = new User(); $user->setName("John"); $post = new Post(); $post->setUser($user); $post->setMaxFeedTitleLength(21); $post->setContent('The hyperactive horse walked into a saloon'); $expectedTitle = 'The hyperactive horse... (John)'; $this->assertEquals($expectedTitle, $post->getFeedItemTitle()); }