2017-11-01 22:26:23 +05:30
|
|
|
<?php
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace api\tests\functional;
|
2017-11-01 22:26:23 +05:30
|
|
|
|
2019-02-21 01:28:52 +05:30
|
|
|
use api\tests\FunctionalTester;
|
2017-11-01 22:26:23 +05:30
|
|
|
|
|
|
|
class FeedbackCest {
|
|
|
|
|
|
|
|
public function testFeedbackWithoutAuth(FunctionalTester $I) {
|
2019-02-21 01:28:52 +05:30
|
|
|
$I->sendPOST('/api/feedback', [
|
2017-11-01 22:26:23 +05:30
|
|
|
'subject' => 'Test',
|
|
|
|
'email' => 'email@ely.by',
|
|
|
|
'type' => 0,
|
|
|
|
'message' => 'Hello world',
|
|
|
|
]);
|
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testFeedbackWithAuth(FunctionalTester $I) {
|
|
|
|
$I->amAuthenticated();
|
2019-02-21 01:28:52 +05:30
|
|
|
$I->sendPOST('/api/feedback', [
|
2017-11-01 22:26:23 +05:30
|
|
|
'subject' => 'Test',
|
|
|
|
'email' => 'email@ely.by',
|
|
|
|
'type' => 0,
|
|
|
|
'message' => 'Hello world',
|
|
|
|
]);
|
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|