Skip to content

Commit 3828501

Browse files
committed
fix tests
1 parent 9081863 commit 3828501

4 files changed

+116
-0
lines changed

tests/integration/external/drupal7/test_bad_params_integer_headers.php

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
/*SKIPIF
1515
<?php
1616
require("skipif.inc");
17+
if (version_compare(PHP_VERSION, "8.0", ">=")) {
18+
die("skip: PHP >= 8.0 not supported\n");
19+
}
1720
*/
1821

1922
/*EXPECT_METRICS
@@ -32,6 +35,11 @@
3235
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
3336
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
3437
[{"name":"Supportability/framework/Drupal/forced"}, [1, 0, 0, 0, 0, 0]],
38+
[{"name":"External/127.0.0.1/all"}, [1, "??", "??", "??", "??", "??"]],
39+
[{"name":"External/all"}, [1, "??", "??", "??", "??", "??"]],
40+
[{"name":"External/allOther"}, [1, "??", "??", "??", "??", "??"]],
41+
[{"name":"External/127.0.0.1/all",
42+
"scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
3543
[{"name":"Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]]
3644
]
3745
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/*DESCRIPTION
4+
Test that adding cross process headers doesn't blow up if the second parameter
5+
is bogus.
6+
*/
7+
8+
// force the framework to avoid requiring the drupal detection file
9+
/*INI
10+
newrelic.framework = drupal
11+
newrelic.distributed_tracing_enabled=0
12+
*/
13+
14+
/*SKIPIF
15+
<?php
16+
require("skipif.inc");
17+
if (version_compare(PHP_VERSION, "8.0", "<")) {
18+
die("skip: PHP < 8.0 not supported\n");
19+
}
20+
*/
21+
22+
/*EXPECT_METRICS
23+
[
24+
"?? agent run id",
25+
"?? timeframe start",
26+
"?? timeframe stop",
27+
[
28+
[{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],
29+
[{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],
30+
[{"name":"Errors/OtherTransaction/php__FILE__"}, [1, 0, 0, 0, 0, 0]],
31+
[{"name":"Errors/all"}, [1, 0, 0, 0, 0, 0]],
32+
[{"name":"Errors/allOther"}, [1, 0, 0, 0, 0, 0]],
33+
[{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]],
34+
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
35+
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
36+
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
37+
[{"name":"Supportability/framework/Drupal/forced"}, [1, 0, 0, 0, 0, 0]],
38+
[{"name":"Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]]
39+
]
40+
]
41+
*/
42+
43+
44+
require_once(realpath(dirname(__FILE__)) . '/../../../include/drupal_7_bootstrap.inc');
45+
require_once(realpath(dirname(__FILE__)) . '/../../../include/drupal_7_common.inc');
46+
require_once(realpath(dirname(__FILE__)) . '/../../../include/config.php');
47+
48+
$url = "http://" . $EXTERNAL_HOST;
49+
50+
drupal_http_request($url, array("headers" => 22));

tests/integration/external/drupal7/test_bad_params_null_headers.php

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
/*SKIPIF
1515
<?php
1616
require("skipif.inc");
17+
if (version_compare(PHP_VERSION, "8.0", ">=")) {
18+
die("skip: PHP >= 8.0 not supported\n");
19+
}
1720
*/
1821

1922
/*EXPECT_METRICS
@@ -32,6 +35,11 @@
3235
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
3336
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
3437
[{"name":"Supportability/framework/Drupal/forced"}, [1, 0, 0, 0, 0, 0]],
38+
[{"name":"External/127.0.0.1/all"}, [1, "??", "??", "??", "??", "??"]],
39+
[{"name":"External/all"}, [1, "??", "??", "??", "??", "??"]],
40+
[{"name":"External/allOther"}, [1, "??", "??", "??", "??", "??"]],
41+
[{"name":"External/127.0.0.1/all",
42+
"scope":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
3543
[{"name":"Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]]
3644
]
3745
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/*DESCRIPTION
4+
Test that adding cross process headers doesn't blow up if the second parameter
5+
is bogus.
6+
*/
7+
8+
// force the framework to avoid requiring the drupal detection file
9+
/*INI
10+
newrelic.framework = drupal
11+
newrelic.distributed_tracing_enabled=0
12+
*/
13+
14+
/*SKIPIF
15+
<?php
16+
require("skipif.inc");
17+
if (version_compare(PHP_VERSION, "8.0", "<")) {
18+
die("skip: PHP < 8.0 not supported\n");
19+
}
20+
*/
21+
22+
/*EXPECT_METRICS
23+
[
24+
"?? agent run id",
25+
"?? timeframe start",
26+
"?? timeframe stop",
27+
[
28+
[{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],
29+
[{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],
30+
[{"name":"Errors/OtherTransaction/php__FILE__"}, [1, 0, 0, 0, 0, 0]],
31+
[{"name":"Errors/all"}, [1, 0, 0, 0, 0, 0]],
32+
[{"name":"Errors/allOther"}, [1, 0, 0, 0, 0, 0]],
33+
[{"name":"OtherTransaction/all"}, [1, "??", "??", "??", "??", "??"]],
34+
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
35+
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
36+
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
37+
[{"name":"Supportability/framework/Drupal/forced"}, [1, 0, 0, 0, 0, 0]],
38+
[{"name":"Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]]
39+
]
40+
]
41+
*/
42+
43+
44+
require_once(realpath(dirname(__FILE__)) . '/../../../include/drupal_7_bootstrap.inc');
45+
require_once(realpath(dirname(__FILE__)) . '/../../../include/drupal_7_common.inc');
46+
require_once(realpath(dirname(__FILE__)) . '/../../../include/config.php');
47+
48+
$url = "http://" . $EXTERNAL_HOST;
49+
50+
drupal_http_request($url, array("headers" => NULL));

0 commit comments

Comments
 (0)