<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('perform some GET requests'); $I->sendGET('/text'); $I->seeHttpHeader('Content-Type', 'text/plain'); $I->seeResponseEquals('yep');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('perform some named routes'); $I->sendGET('/route1'); $I->seeResponseEquals('hello world'); $I->sendGET('/route2'); $I->seeResponseEquals('hello world'); $I->sendGET('/route3'); $I->seeResponseEquals('hello world');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('perform not founding request'); $I->sendGET('/wdwadwadwayccy'); $I->seeResponseCodeIs(404); $I->seeResponseEquals('1');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('check events'); $I->sendGET('/event'); $I->seeResponseEquals('/event');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('check callback parameters'); $I->sendGET('/parameters'); $I->seeResponseEquals('yup'); $I->sendGET('/parameters/app'); $I->seeResponseEquals('Hahns\\Hahns'); $I->sendGET('/parameters/invalid'); $I->seeResponseCodeIs(500);
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('check events'); $I->sendDELETE('/any'); $I->seeResponseEquals('any'); $I->sendGET('/any'); $I->seeResponseEquals('any'); $I->sendPATCH('/any'); $I->seeResponseEquals('any'); $I->sendPOST('/any'); $I->seeResponseEquals('any'); $I->sendPUT('/any'); $I->seeResponseEquals('any');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('check response headers'); $I->sendGET('/header/using/header/bli/blub'); $I->seeHttpHeader('bli', 'blub'); $I->sendGET('/header/code/created'); $I->canSeeResponseCodeIs(201); $I->sendGET('/header/code/created/by/send'); $I->canSeeResponseCodeIs(201); $I->haveHttpHeader('bla', 'roflcopter'); $I->sendGET('/header/return/bla'); $I->seeResponseEquals('roflcopter'); $I->haveHttpHeader('X-Bla', 'doge'); $I->sendGET('/header/return/xbla'); $I->seeResponseEquals('doge');
<?php /* @var \Codeception\Scenario $scenario */ $I = new TestGuy($scenario); $I->wantTo('perform some GET requests'); $I->sendGET('/html'); $I->seeHttpHeader('Content-Type', 'text/html'); $I->seeResponseEquals('<h1>yep</h1>');