Ojs\JournalBundle\Tests\Controller\ArticleAuthorControllerTest::testNew PHP Method

testNew() public method

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/journal/1/article/1/author/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=article_author]')->form();
        $form['article_author[author][translations][en][biography]'] = 'Biography En - Phpunit';
        $form['article_author[author][translations][tr][biography]'] = 'Biography Tr - Phpunit';
        $form['article_author[author][title]'] = '1';
        $form['article_author[author][firstName]'] = 'FirstName phpunit';
        $form['article_author[author][lastName]'] = 'LastName phpunit';
        $form['article_author[author][phone]'] = '05005005050';
        $form['article_author[author][email]'] = '[email protected]';
        $form['article_author[author][institution]'] = '1';
        $form['article_author[authorOrder]'] = '1';
        $crawler = $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('FirstName phpunit', $this->client->getResponse()->getContent());
    }