Skip to content

Commit b7fe442

Browse files
hahuja2mfulb
authored andcommitted
chore(axiom): add integration tests
1 parent addcdec commit b7fe442

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/*
3+
* Copyright 2020 New Relic Corporation. All rights reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*DESCRIPTION
8+
Test the use case where five parameters are passed into newrelic_notice_error and
9+
ensure all parameters show up as error attributes.
10+
*/
11+
12+
/*EXPECT_ERROR_EVENTS
13+
[
14+
"?? agent run id",
15+
{
16+
"reservoir_size": 100,
17+
"events_seen": 1
18+
},
19+
[
20+
[
21+
{
22+
"type": "TransactionError",
23+
"timestamp": "??",
24+
"error.class": "NoticedError",
25+
"error.message": "Test Error Has Occurred!",
26+
"error.file": "random.php",
27+
"error.line": 46,
28+
"error.context": "Random Error Has Been Detected",
29+
"error.no": 256,
30+
"transactionName": "??",
31+
"duration": "??",
32+
"nr.transactionGuid": "??",
33+
"guid": "??",
34+
"sampled": "??",
35+
"priority": "??",
36+
"traceId": "??",
37+
"spanId": "??"
38+
},
39+
{},
40+
{}
41+
]
42+
]
43+
]
44+
*/
45+
46+
newrelic_notice_error(256, "Test Error Has Occurred!", "random.php", 46, "Random Error Has Been Detected");
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/*
3+
* Copyright 2020 New Relic Corporation. All rights reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/*DESCRIPTION
8+
Test the use case where two parameters are passed into newrelic_notice_error
9+
and the exception is shown as the error message.
10+
*/
11+
12+
/*EXPECT_ERROR_EVENTS
13+
[
14+
"?? agent run id",
15+
{
16+
"reservoir_size": 100,
17+
"events_seen": 1
18+
},
19+
[
20+
[
21+
{
22+
"type": "TransactionError",
23+
"timestamp": "??",
24+
"error.class": "Exception",
25+
"error.message": "Noticed exception 'Exception' with message 'Sample Exception' in __FILE__:??",
26+
"transactionName": "??",
27+
"duration": "??",
28+
"nr.transactionGuid": "??",
29+
"guid": "??",
30+
"sampled": "??",
31+
"priority": "??",
32+
"traceId": "??",
33+
"spanId": "??"
34+
},
35+
{},
36+
{}
37+
]
38+
]
39+
]
40+
*/
41+
42+
newrelic_notice_error("Test Error Has Occurred!", new Exception('Sample Exception'));

0 commit comments

Comments
 (0)