<?php /** * Test for https://github.com/phalcon/forum/issues/85 issue * * @var \Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('use underscored character in content and see correct url'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(['name' => 'Installation', 'slug' => 'installation', 'description' => 'Installation related posts']); $postId = $I->havePost(['title' => 'Is there a precompiled binary for 64 bit Centos out there', 'content' => '[this reddit topic](http://www.reddit.com/r/PHP/comments/2s7bbr/phalconphp_vs_php_disappointing_results/)', 'users_id' => $userId, 'slug' => 'is-there-a-precompiled-binary-for-64-bit-centos-out-there', 'categories_id' => $catId]); $I->amOnPage('/discussions'); $I->seeInTitle('Discussions - Phalcon Framework'); $I->seeLink('Is there a precompiled binary for 64 bit Centos out there'); $I->click('Is there a precompiled binary for 64 bit Centos out there'); $I->seeInCurrentUrl(sprintf('/discussion/%s/is-there-a-precompiled-binary-for-64-bit-centos-out-there', $postId)); $I->seeLink('this reddit topic', 'http://www.reddit.com/r/PHP/comments/2s7bbr/phalconphp%5vs%5php%5disappointing%5results/');
<?php /** * @var \Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('reply in a discussion'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(['name' => 'Testing', 'slug' => 'test', 'description' => 'codeception functional test']); $postId = $I->havePost(['title' => 'Please help with testing', 'content' => 'How can I install Codeception', 'users_id' => $userId, 'slug' => 'please-help-with-testing', 'categories_id' => $catId]); $I->amOnPage("/discussions"); $I->seeLink('Please help with testing'); $I->click('Please help with testing'); $I->see('Please help with testing', 'h1'); $I->fillField('#content', 'I can do that!'); $I->click('Add Comment'); $I->see('I can do that!', '.post-content');
<?php /** * @var \Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('see latest post on front page at top of table'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(['name' => 'Database', 'slug' => 'database', 'description' => 'Database questions']); $postId = $I->havePost(['title' => 'Binding Parameters', 'content' => 'This may be a little bit of a noob question but here goes.', 'users_id' => $userId, 'slug' => 'binding-parameters', 'categories_id' => $catId]); $I->amOnPage('/'); $I->seeInTitle('Discussions - Phalcon Framework'); $I->seeElement('//table/tr[2]/td[2]'); $I->see('Binding Parameters', '//table/tr[2]/td[2]'); $I->click('Binding Parameters'); $I->see('Binding Parameters', 'h1');
<?php /** * @var Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('use the mention name as a link'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(); $postId = $I->havePost(['title' => 'Router Phalcon', 'content' => 'I have a question I could not find anywhere, and I ask @123456789, ' . '@12er45t and @iregular help. Let me test: @%, @&abcd and xxx@xxx', 'users_id' => $userId, 'categories_id' => $catId]); $I->amOnPage('/discussions'); $I->click('Router Phalcon'); $I->see('I have a question I could not find anywhere, and I ask @123456789, @12er45t and @iregular help.', '.post-content'); $I->seeLink('@123456789', '/user/0/123456789'); $I->seeLink('@12er45t', '/user/0/12er45t'); $I->seeLink('@iregular', '/user/0/iregular'); $I->dontSeeLink('@%', '/user/0/%'); $I->dontSeeLink('@&abcd', '/user/0/&abcd'); $I->dontSeeLink('xxx@xxx', '/user/0/xxxxxx'); $I->dontSeeLink('@xxx', '/user/0/xxx');
<?php /** * @var Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('reply in a discussion'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(); $postId = $I->havePost(['title' => 'Please help with testing', 'users_id' => $userId, 'categories_id' => $catId]); $I->amOnPage("/discussions"); $I->seeLink('Please help with testing'); $I->click('Please help with testing'); $I->see('Please help with testing', 'h1'); $I->fillField('#content', 'I can do that!'); $I->click('Add Comment'); $I->see('I can do that!', '.post-content');
<?php /** * @issue 87 * @var Codeception\Scenario $scenario */ $I = new Step\Functional\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 - Phalcon Framework'); $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 /** * Test for https://github.com/phalcon/forum/issues/87 issue * * @var \Codeception\Scenario $scenario */ $I = new Step\Functional\UserSteps($scenario); $I->wantTo('use illegal characters in title and get correct slug'); $userId = $I->amRegularUser(); $catId = $I->haveCategory(['name' => 'ORM', 'slug' => 'orm', 'description' => 'ORM related posts']); $postId = $I->havePost(['title' => 'model->save() return TRUE when no matching database column', 'content' => 'some content', 'users_id' => $userId, 'categories_id' => $catId]); $I->amOnPage('/'); $I->seeInTitle('Discussions - Phalcon Framework'); $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));