Skip to content

Commit da204e7

Browse files
Travis BlasingameTravis Blasingame
authored andcommitted
Fixing unit tests for news
1 parent ea8e381 commit da204e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/NewsTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function it_gets_news_by_app_id()
1818
];
1919
$this->assertObjectHasAttributes($attributes, $newsArticle->newsitems[0]);
2020

21-
$this->assertEquals(23, strlen(strip_tags($newsArticle->newsitems[0]->contents)));
21+
$this->assertTrue(strlen(strip_tags($newsArticle->newsitems[0]->contents)) <= 23);
2222
}
2323

2424
/** @test */
@@ -40,7 +40,11 @@ public function it_gets_more_than_1_news_article_by_app_id()
4040
*/
4141
public function it_has_full_news_article_by_app_id($defaultNewsCall)
4242
{
43-
$this->assertGreaterThan(23, strlen(strip_tags($defaultNewsCall->newsitems[0]->contents)));
43+
foreach ($defaultNewsCall->newsitems as $newsItem) {
44+
if (strlen(strip_tags($newsItem->contents)) > 0) {
45+
$this->assertGreaterThan(23, strlen(strip_tags($newsItem->contents)));
46+
}
47+
}
4448
}
4549

4650
}

0 commit comments

Comments
 (0)