FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sentry-php/tests/MonitorConfigTest.php at source-frame-cache · 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
20
Pull requests
11
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
/
MonitorConfigTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (49 loc) · 1.85 KB
Breadcrumbs
sentry-php
/
tests
/
MonitorConfigTest.php
Copy path
File metadata and controls
57 lines (49 loc) · 1.85 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare
(strict_types=
1
);
namespace
Sentry
\
Tests
;
use
PHPUnit
\
Framework
\
TestCase
;
use
Sentry
\
MonitorConfig
;
use
Sentry
\
MonitorSchedule
;
final
class
MonitorConfigTest
extends
TestCase
{
public
function
testConstructor
():
void
{
$
monitorSchedule
= MonitorSchedule::
crontab
(
'
* * * * *
'
);
$
monitorConfig
=
new
MonitorConfig
(
MonitorSchedule::
crontab
(
'
* * * * *
'
),
10
,
12
,
'
Europe/Amsterdam
'
,
5
,
10
);
$
this
->
assertEquals
(
$
monitorSchedule
,
$
monitorConfig
->
getSchedule
());
$
this
->
assertEquals
(
10
,
$
monitorConfig
->
getCheckinMargin
());
$
this
->
assertEquals
(
12
,
$
monitorConfig
->
getMaxRuntime
());
$
this
->
assertEquals
(
'
Europe/Amsterdam
'
,
$
monitorConfig
->
getTimezone
());
$
this
->
assertEquals
(
5
,
$
monitorConfig
->
getFailureRecoveryThreshold
());
$
this
->
assertEquals
(
10
,
$
monitorConfig
->
getRecoveryThreshold
());
}
/**
* @dataProvider gettersAndSettersDataProvider
*/
public
function
testGettersAndSetters
(
string
$
getterMethod
,
string
$
setterMethod
,
$
expectedData
):
void
{
$
monitorConfig
=
new
MonitorConfig
(
MonitorSchedule::
crontab
(
'
* * * * *
'
)
);
$
monitorConfig
->
$
setterMethod
(
$
expectedData
);
$
this
->
assertEquals
(
$
expectedData
,
$
monitorConfig
->
$
getterMethod
());
}
public
static
function
gettersAndSettersDataProvider
():
array
{
return
[
[
'
getSchedule
'
,
'
setSchedule
'
, MonitorSchedule::
crontab
(
'
foo
'
)],
[
'
getCheckinMargin
'
,
'
setCheckinMargin
'
,
10
],
[
'
getMaxRuntime
'
,
'
setMaxRuntime
'
,
12
],
[
'
getTimezone
'
,
'
setTimezone
'
,
'
Europe/Amsterdam
'
],
[
'
getFailureRecoveryThreshold
'
,
'
setFailureRecoveryThreshold
'
,
5
],
[
'
getRecoveryThreshold
'
,
'
setRecoveryThreshold
'
,
10
],
];
}
}
Back
|
FazBrowse Home
|
New Git URL