<?php /** * @issue 87 * @var Codeception\Scenario $scenario */ $I = new Step\UserSteps($scenario); $I->wantTo('use illegal characters in title and get correct slug'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(); $postId = $I->havePost(['title' => 'model->save() return TRUE when no matching database column', 'users_id' => $userId, 'categories_id' => $catId, 'slug' => false]); $I->amOnPage('/'); $I->seeInTitle('Discussions - '); $I->seeLink('model->save() return TRUE when no matching database column'); $I->click('model->save() return TRUE when no matching database column'); $I->seeInCurrentUrl(sprintf('/discussion/%s/modelsave-return-true-when-no-matching-database-column', $postId));
<?php /** * @var Codeception\Scenario $scenario */ $I = new Step\UserSteps($scenario); $I->wantTo('start a discussion'); $I->amRegularUser(); $I->haveCategory(['name' => 'Testing']); $I->amOnPage('/'); $I->see('Start a Discussion'); $I->click('Start a Discussion'); $I->see('Start a Discussion', 'h1'); $I->seeRecord('Phosphorum\\Models\\Categories', ['name' => 'Testing']); $I->fillField('#title', 'How can I write tests in Codeception'); $I->fillField('#content', 'Is there any manual'); $I->selectOption('#categoryId', 'Testing'); $I->click('Submit Discussion'); $I->see('How can I write tests in Codeception', 'h1'); $I->seeInCurrentUrl('/how-can-i-write-tests-in-codeception');