⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.138
Server IP:
186.226.58.36
Server:
Linux da02.sh15.net 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Server Software:
Apache/2
PHP Version:
8.1.32
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
redesystem
/
public_html
/
sys
/
tests
/
View File Name :
ApiTestTrait.php
<?php namespace Tests; trait ApiTestTrait { private $response; public function assertApiResponse(array $actualData) { $this->assertApiSuccess(); $response = json_decode($this->response->getContent(), true); $responseData = $response['data']; $this->assertNotEmpty($responseData['id']); $this->assertModelData($actualData, $responseData); } public function assertApiSuccess() { $this->response->assertStatus(200); $this->response->assertJson(['success' => true]); } public function assertModelData(array $actualData, array $expectedData) { foreach ($actualData as $key => $value) { if (in_array($key, ['created_at', 'updated_at'])) { continue; } $this->assertEquals($actualData[$key], $expectedData[$key]); } } }