FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sentry-php/tests/bootstrap.php at sensitive-data-scrubber · getsentry/sentry-php · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
getsentry
/
sentry-php
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
475
Star
1.9k
Code
Issues
18
Pull requests
13
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
sentry-php
/
tests
/
bootstrap.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (26 loc) · 1.19 KB
Breadcrumbs
sentry-php
/
tests
/
bootstrap.php
Copy path
File metadata and controls
30 lines (26 loc) · 1.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
declare
(strict_types=
1
);
use
Sentry
\
Breadcrumb
;
use
Sentry
\
Event
;
use
Sentry
\
Metrics
\
Metrics
;
use
Sentry
\
Tests
\
TestUtil
\
ClockMock
;
use
Sentry
\
Tracing
\
Span
;
use
Sentry
\
Transport
\
RateLimiter
;
require_once
__DIR__
.
'
/../vendor/autoload.php
'
;
// According to the Symfony documentation the proper way to register the mocked
// functions for a certain class would be to configure the listener in the
// phpunit.xml file, however in our case it doesn't work because PHPUnit loads
// the data providers of the tests long before instantiating the listeners. In
// turn, PHP caches the functions to call to avoid looking up in the function
// table again and again, therefore if for any reason the method that should use
// a mocked function gets called before the mock itself gets created it will not
// use the mocked methods.
//
// See https://symfony.com/doc/current/components/phpunit_bridge.html#troubleshooting
// See https://bugs.php.net/bug.php?id=64346
ClockMock::
register
(Event::class);
ClockMock::
register
(Breadcrumb::class);
ClockMock::
register
(Span::class);
ClockMock::
register
(RateLimiter::class);
ClockMock::
register
(Metrics::class);
ClockMock::
register
(
Sentry
\
Serializer
\PayloadSerializer::class);
Back
|
FazBrowse Home
|
New Git URL