Ojs\AdminBundle\Tests\Controller\AdminInstitutionControllerTest::testNew PHP Method

testNew() public method

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/admin/institution/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=institution]')->form();
        $form['institution[name]'] = 'Institution Name';
        $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('Institution Name', $client->getResponse()->getContent());
    }