GcFrontend\Controller\IndexControllerTest::testIndexActionWithUrlKeyWithPreview PHP Метод

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

Test
public testIndexActionWithUrlKeyWithPreview ( ) : void
Результат void
    public function testIndexActionWithUrlKeyWithPreview()
    {
        $auth = new AuthenticationService(new Storage\Session(UserModel::BACKEND_AUTH_NAMESPACE));
        $auth->clearIdentity();
        $document = DocumentModel::fromArray(array('name' => 'test', 'url_key' => 'test', 'status' => DocumentModel::STATUS_ENABLE, 'user_id' => $this->user->getId(), 'document_type_id' => $this->documentType->getId(), 'view_id' => $this->view->getId(), 'layout_id' => $this->layout->getId(), 'parent_id' => null));
        $document->save();
        $this->dispatch($document->getUrl() . '?preview');
        $this->assertResponseStatusCode(200);
        $this->assertModuleName('GcFrontend');
        $this->assertControllerName('IndexController');
        $this->assertControllerClass('IndexController');
        $this->assertMatchedRouteName('cms');
        $document->delete();
        $enableCache = $this->config->setValue('cache_is_active', 0);
    }