OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
firebase-php
/
tests
/
Integration
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:34:14 AM
rwxr-xr-x
📁
Auth
-
08/12/2024 10:35:40 AM
rwxr-xr-x
📄
AuthTest.php
24.98 KB
08/12/2024 10:34:13 AM
rw-r--r--
📁
Database
-
08/12/2024 10:35:40 AM
rwxr-xr-x
📄
DatabaseTest.php
646 bytes
08/12/2024 10:34:13 AM
rw-r--r--
📄
DatabaseTestCase.php
1.68 KB
08/12/2024 10:34:13 AM
rw-r--r--
📄
DynamicLinksTest.php
2.8 KB
08/12/2024 10:34:13 AM
rw-r--r--
📄
FirestoreTest.php
1.27 KB
08/12/2024 10:34:13 AM
rw-r--r--
📄
HttpLoggingTest.php
2.11 KB
08/12/2024 10:34:13 AM
rw-r--r--
📁
Messaging
-
08/12/2024 10:35:40 AM
rwxr-xr-x
📄
MessagingTest.php
13.24 KB
08/12/2024 10:34:13 AM
rw-r--r--
📄
RemoteConfigTest.php
10.89 KB
08/12/2024 10:34:13 AM
rw-r--r--
📁
Request
-
08/12/2024 10:35:40 AM
rwxr-xr-x
📄
StorageTest.php
1.01 KB
08/12/2024 10:34:13 AM
rw-r--r--
📄
TenantAwareAuthTest.php
1.89 KB
08/12/2024 10:34:13 AM
rw-r--r--
Editing: HttpLoggingTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Tests\Integration; use Kreait\Firebase\Contract\Auth; use Kreait\Firebase\Exception\Auth\UserNotFound; use Kreait\Firebase\Tests\IntegrationTestCase; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; /** * @internal */ final class HttpLoggingTest extends IntegrationTestCase { /** @var MockObject&LoggerInterface */ private $logger; /** @var MockObject&LoggerInterface */ private $debugLogger; private Auth $auth; private Auth $authWithLogger; private Auth $authWithDebugLogger; protected function setUp(): void { parent::setUp(); $this->logger = $this->createMock(LoggerInterface::class); $this->debugLogger = $this->createMock(LoggerInterface::class); $this->auth = self::$factory->createAuth(); $this->authWithLogger = self::$factory->withHttpLogger($this->logger)->createAuth(); $this->authWithDebugLogger = self::$factory->withEnabledDebug($this->debugLogger)->createAuth(); } public function testItLogsSuccesses(): void { $user = $this->auth->createAnonymousUser(); try { $this->logger->expects($this->atLeastOnce())->method('log'); $this->authWithLogger->getUser($user->uid); } finally { $this->auth->deleteUser($user->uid); } } public function testItLogsFailures(): void { $this->debugLogger->expects($this->atLeastOnce())->method('log'); try { $this->authWithDebugLogger->updateUser('does-not-exist', []); } catch (\Throwable $e) { $this->assertInstanceOf(UserNotFound::class, $e); } } public function testItUsesAHttpDebugLogger(): void { $user = $this->auth->createAnonymousUser(); try { $this->debugLogger->expects($this->atLeastOnce())->method('log'); $this->authWithDebugLogger->getUser($user->uid); } finally { $this->auth->deleteUser($user->uid); } } }