Eko\FeedBundle\Tests\Formatter\AtomFormatterTest::testAuthorEmptyException PHP Method

testAuthorEmptyException() public method

Check if exception is an \InvalidArgumentException is thrown when 'author' config parameter is not set or empty.
    public function testAuthorEmptyException()
    {
        $config = ['feeds' => ['article' => ['title' => 'My title', 'description' => 'My description', 'link' => 'http://github.com/eko/FeedBundle', 'encoding' => 'utf-8', 'author' => '']]];
        $translator = $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface');
        $formatters = ['rss' => new RssFormatter($translator, 'test'), 'atom' => new AtomFormatter($translator, 'test')];
        $manager = new FeedManager($this->getMockRouter(), $config, $formatters);
        $feed = $manager->get('article');
        $this->setExpectedException('InvalidArgumentException', 'Atom formatter requires an "author" parameter in configuration.');
        $feed->set('author', null);
        $feed->render('atom');
    }