OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
znew1aws-ses
/
vendor
/
guzzlehttp
/
guzzle
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
ClientTest.php
31.28 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
Cookie
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📁
Exception
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📁
Handler
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
HandlerStackTest.php
7.43 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
Helpers.php
975 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
HttplugIntegrationTest.php
369 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
InternalUtilsTest.php
569 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
MessageFormatterTest.php
4.11 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
MiddlewareTest.php
9.88 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PoolTest.php
6.42 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PrepareBodyMiddlewareTest.php
5.36 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RedirectMiddlewareTest.php
20.48 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RetryMiddlewareTest.php
3.01 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
Server.php
6.12 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
TestLogger.php
2.77 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
TransferStatsTest.php
995 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
UtilsTest.php
5.48 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bootstrap-phpstan.php
173 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
bootstrap.php
1.05 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
server.js
8.12 KB
03/03/2025 08:37:06 AM
rw-r--r--
Editing: TestLogger.php
Close
<?php namespace GuzzleHttp\Tests; use Psr\Log\AbstractLogger; /** * Used for testing purposes. * * It records all records and gives you access to them for verification. */ class TestLogger extends AbstractLogger { public $records = []; public $recordsByLevel = []; public function log($level, $message, array $context = []): void { $record = [ 'level' => $level, 'message' => $message, 'context' => $context, ]; $this->recordsByLevel[$record['level']][] = $record; $this->records[] = $record; } public function hasRecords($level) { return isset($this->recordsByLevel[$level]); } public function hasRecord($record, $level) { if (is_string($record)) { $record = ['message' => $record]; } return $this->hasRecordThatPasses(static function ($rec) use ($record) { if ($rec['message'] !== $record['message']) { return false; } if (isset($record['context']) && $rec['context'] !== $record['context']) { return false; } return true; }, $level); } public function hasRecordThatContains($message, $level) { return $this->hasRecordThatPasses(static function ($rec) use ($message) { return strpos($rec['message'], $message) !== false; }, $level); } public function hasRecordThatMatches($regex, $level) { return $this->hasRecordThatPasses(static function ($rec) use ($regex) { return preg_match($regex, $rec['message']) > 0; }, $level); } public function hasRecordThatPasses(callable $predicate, $level) { if (!isset($this->recordsByLevel[$level])) { return false; } foreach ($this->recordsByLevel[$level] as $i => $rec) { if ($predicate($rec, $i)) { return true; } } return false; } public function __call($method, $args) { if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { $genericMethod = $matches[1].('Records' !== $matches[3] ? 'Record' : '').$matches[3]; $level = strtolower($matches[2]); if (method_exists($this, $genericMethod)) { $args[] = $level; return ($this->{$genericMethod})(...$args); } } throw new \BadMethodCallException('Call to undefined method '.static::class.'::'.$method.'()'); } public function reset() { $this->records = []; $this->recordsByLevel = []; } }