Ojs\JournalBundle\Tests\Controller\SectionControllerTest::testNew PHP Метод

testNew() публичный Метод

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/journal/1/section/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=section]')->form();
        $form['section[translations][en][title]'] = 'Section Title - phpunit';
        $form['section[translations][tr][title]'] = 'Section Title - phpunit';
        $form['section[allowIndex]'] = '1';
        $form['section[sectionOrder]'] = '1';
        $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('Section Title - phpunit', $this->client->getResponse()->getContent());
    }