BryanDavis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/173085
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/85/173085/1
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: newchange
Gerrit-Change-Id: I5541a062ff0c47ca8802315554b3f32dfd01dcd0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits