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

testNew() public method

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/journal/1/article/1/file/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=article_file]')->form();
        $form['article_file[file]'] = 'file';
        $form['article_file[type]'] = '0';
        $form['article_file[langCode]'] = '1';
        $form['article_file[title]'] = 'Article File - phpunit';
        $form['article_file[description]'] = 'description - phpunit';
        $crawler = $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('Article File - phpunit', $this->client->getResponse()->getContent());
    }