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

testNew() public method

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/admin/contact-type/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=contact_types]')->form();
        $form['contact_types[translations][' . $this->locale . '][name]'] = 'Contact Name';
        $form['contact_types[translations][' . $this->locale . '][description]'] = 'Contact Description';
        $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('Contact Name', $this->client->getResponse()->getContent());
    }