-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup post and put for adding new data
- Loading branch information
Showing
3 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace App\Tests\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
class IndexControllerTest extends WebTestCase | ||
{ | ||
public function testAll() | ||
{ | ||
$client = static::createClient(); | ||
|
||
$client->request('GET', '/'); | ||
|
||
$this->assertResponseIsSuccessful(); | ||
$this->assertResponseHeaderSame('Content-Type', 'application/json'); | ||
|
||
$data = json_decode($client->getResponse()->getContent(), true); | ||
|
||
// Assert the structure of the JSON response | ||
$this->assertArrayHasKey('currentPage', $data); | ||
$this->assertArrayHasKey('pageSize', $data); | ||
$this->assertArrayHasKey('results', $data); | ||
$this->assertArrayHasKey('numResults', $data); | ||
|
||
} | ||
} |