Skip to content

Commit b09c4cb

Browse files
committed
fix(agent): Modfies newrelic_notice_error() 4 argument test
It is now valid to pass 4 arguments to newrelic_notice_error() so it was necessary to modify the test case.
1 parent 52f56cc commit b09c4cb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/integration/api/notice_error/test_bad_inputs.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
ok - 2 args
1616
ok - 3 args
1717
ok - 4 args
18+
ok - 4 args
19+
ok - 4 args
20+
ok - 4 args
1821
ok - 5 args
1922
ok - 6 args
2023
*/
@@ -32,9 +35,15 @@
3235
tap_equal(null, newrelic_notice_error("", 42), "2 args");
3336
tap_equal(null, newrelic_notice_error("", array()), "2 args");
3437

35-
// Three and four argument forms are not allowed.
38+
// Three argument forms are not allowed.
3639
tap_equal(null, newrelic_notice_error(42, "message", "file"), "3 args");
37-
tap_equal(null, newrelic_notice_error(42, "message", "file", __LINE__), "4 args");
40+
41+
// Four argument form requires integer, string, string, integer
42+
// This is like the five argument form but for PHP 8+ where the context is not supplied
43+
tap_equal(null, newrelic_notice_error("", "message", "file", __LINE__), "4 args");
44+
tap_equal(null, newrelic_notice_error(42, array(), "file", __LINE__), "4 args");
45+
tap_equal(null, newrelic_notice_error("", "message", array(), __LINE__), "4 args");
46+
tap_equal(null, newrelic_notice_error("", "message", "file", ""), "4 args");
3847

3948
// Five argument form requires second arg to be convertible to a string.
4049
tap_equal(null, newrelic_notice_error("", curl_init()), "5 args");

0 commit comments

Comments
 (0)