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 {
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public function testFeedbackWithoutAuth(FunctionalTester $I): void {
|
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,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
public function testFeedbackWithAuth(FunctionalTester $I): void {
|
2017-11-01 22:26:23 +05:30
|
|
|
$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,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|