jenkins-bot has submitted this change and it was merged.
Change subject: Work around test provider running before setUp()
......................................................................
Work around test provider running before setUp()
If the xhprof extension is not present we skip running the test, but
phpunit runs the test provider function before that check so we need to
guard against missing constants to avoid spurious warnings in the test
output.
Change-Id: I5541a062ff0c47ca8802315554b3f32dfd01dcd0
---
M tests/phpunit/includes/libs/XhprofTest.php
1 file changed, 15 insertions(+), 6 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/libs/XhprofTest.php
b/tests/phpunit/includes/libs/XhprofTest.php
index e0e68e0..cc81aba 100644
--- a/tests/phpunit/includes/libs/XhprofTest.php
+++ b/tests/phpunit/includes/libs/XhprofTest.php
@@ -69,14 +69,23 @@
}
public function provideRawData() {
- return array(
+ $tests = array(
array( 0, array( 'ct', 'wt' ) ),
- array( XHPROF_FLAGS_MEMORY, array( 'ct', 'wt', 'mu',
'pmu' ) ),
- array( XHPROF_FLAGS_CPU, array( 'ct', 'wt', 'cpu' ) ),
- array( XHPROF_FLAGS_MEMORY | XHPROF_FLAGS_CPU, array(
- 'ct', 'wt', 'mu', 'pmu', 'cpu',
- ) ),
);
+
+ if ( defined( 'XHPROF_FLAGS_CPU' ) && defined(
'XHPROF_FLAGS_CPU' ) ) {
+ $tests[] = array( XHPROF_FLAGS_MEMORY, array(
+ 'ct', 'wt', 'mu', 'pmu',
+ ) );
+ $tests[] = array( XHPROF_FLAGS_CPU, array(
+ 'ct', 'wt', 'cpu',
+ ) );
+ $tests[] = array( XHPROF_FLAGS_MEMORY |
XHPROF_FLAGS_CPU, array(
+ 'ct', 'wt', 'mu', 'pmu', 'cpu',
+ ) );
+ }
+
+ return $tests;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/173085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5541a062ff0c47ca8802315554b3f32dfd01dcd0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits