Skip to content

Commit 64683a4

Browse files
author
Harrison Ifeanyichukwu
committed
test: test ability to add and update feed's default language
1 parent ca37150 commit 64683a4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/ParserTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Forensic\FeedParser\Exceptions\InvalidURLException;
99
use Forensic\FeedParser\Exceptions\ResourceNotFoundException;
1010
use Forensic\FeedParser\Exceptions\FileNotFoundException;
11+
use Forensic\FeedParser\Exceptions\MalformedFeedException;
12+
use Forensic\FeedParser\Exceptions\FeedTypeNotSupportedException;
1113

1214
class ParserTest extends TestCase
1315
{
@@ -18,6 +20,23 @@ public function setup()
1820
$this->_parser = new Parser();
1921
}
2022

23+
public function testDefaultLanguage()
24+
{
25+
$this->assertSame('en', $this->_parser->getDefaultLanguage());
26+
}
27+
28+
public function testUpdateDefaultLanguage()
29+
{
30+
$this->_parser->setDefaultLanguage('fr');
31+
$this->assertSame('fr', $this->_parser->getDefaultLanguage());
32+
}
33+
34+
public function testConstructDefaultLanguageOption()
35+
{
36+
$parser = new Parser('fr');
37+
$this->assertSame('fr', $parser->getDefaultLanguage());
38+
}
39+
2140
public function testInvalidUrl()
2241
{
2342
$this->expectException(InvalidURLException::class);

0 commit comments

Comments
 (0)