Ejemplo n.º 1
0
<?php

/** @type \Codeception\Scenario $scenario */
$scenario->groups('content');
$I = new WebGuy\MemberSteps($scenario);
$I->wantTo('Publish my post');
$I->amGoingTo('Write a post, edit it, delete it, write lots of posts');
$I->autoLogin();
$I->writePost('', '');
$I->seeCurrentUrlEquals(\PostFormPage::$newPostUrl);
\PostFormPage::of($I)->hasErrors();
$I->writePost('What a title', '');
$I->seeCurrentUrlEquals(\PostFormPage::$newPostUrl);
\PostFormPage::of($I)->hasErrors();
$I->writePost('What a title', 'whatapost');
$I->seeCurrentUrlEquals(\PostFormPage::$newPostUrl);
\PostFormPage::of($I)->hasErrors();
$I->writePost('', 'whatapostapost');
$I->seeCurrentUrlEquals(\PostFormPage::$newPostUrl);
\PostFormPage::of($I)->hasErrors();
$I->writePost('What a title', '*whatapostapost*');
$I->dontSeeInCurrentUrl(\PostFormPage::$newPostUrl);
\PostFormPage::of($I)->hasNoErrors();
$I->seeCurrentUrlEquals(\PostPage::route('what-a-title'));
$I->see('whatapostapost', 'article em');
$I->seeInTitle('What a title');
$I->seeLink('link.edit');
$I->click('link.edit');
$id = $I->grabFromCurrentUrl('~(\\d+)~');
$I->amOnPage(\BlogFeedPage::$url);
$I->see('What a title', '.sidebar');