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

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

public testNew ( )
    public function testNew()
    {
        $this->logIn();
        $client = $this->client;
        $crawler = $client->request('GET', '/journal/1/block/new');
        $this->assertStatusCode(200, $client);
        $form = $crawler->filter('form[name=block]')->form();
        $form['block[translations][en][title]'] = 'Block title - phpunit';
        $form['block[translations][en][content]'] = 'content en - phpunit';
        $form['block[translations][tr][title]'] = 'Block title - phpunit';
        $form['block[translations][tr][content]'] = 'content tr - phpunit';
        $form['block[blockOrder]'] = '1';
        $form['block[color]'] = 'default';
        $crawler = $client->submit($form);
        $this->assertTrue($client->getResponse()->isRedirect());
        $client->followRedirect();
        $this->assertContains('Block title - phpunit', $this->client->getResponse()->getContent());
    }