Commit graph

11 commits

Author SHA1 Message Date
Platonides
d197824c54 Replace a bunch of extension_loaded() checks with checkPHPExtension()
Change-Id: I7bd9bc3a753975f45e63532d4f07aeff853b9970
2014-01-23 23:09:53 +00:00
aude
3c57bec275 Call parent::setUp() in DiffHistoryBlobTest before marking skipped tests
Jenkins skips these tests because xdiff is unavailable. The tests get
marked as skipped, out of order and before the error reporting setup.

Things are left in an inconsistent state when running *all* the tests together,
and interferes with later error handling (including PHPUnit_Framework_Error)
in other tests.

The gate-and-submit and other jobs are split into multiple jobs,
and for some reason does not trigger this issue.

This will probably fix bug 57488.

Bug: 57488
Change-Id: Ie1a213e912b5858b43956fc35cf00226636f2093
2013-11-24 00:29:57 +00:00
addshore
9c540db2df @covers tags for inclues/*Test
Change-Id: Id28acdd8fe0028bf1e46344cfed131076c8f4c95
2013-10-24 11:54:02 +01:00
addshore
de7af7ac2c Fix scope on all /phpunit test methods
Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
2013-10-24 10:31:32 +02:00
Kevin Israel
7751b289e4 DiffHistoryBlob: don't check for mhash extension
Checking for the mhash extension is pointless in PHP 5.3+ because
it only exists as B/C functions that are part of the hash extension.

From ext/hash/config.m4:

    if test "$PHP_MHASH" != "no"; then
      if test "$PHP_HASH" = "no"; then
        PHP_HASH="yes"
      fi

      AC_DEFINE(PHP_MHASH_BC, 1, [ ])
    fi

So if mhash() is compiled in, hash() must also be compiled in.

Change-Id: Ic376f4c438aaf701ebb4f1394ab6e4c1803fb8b8
2013-07-30 11:44:03 -04:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Antoine Musso
0fd05285d7 pass codesniffer on tests/
Fix almost all occurences of the following sniffs:

Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility

Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
2013-01-28 12:14:26 +01:00
Platonides
bd5fff091c Add the required call to the parent setUp to DiffHistoryBlobTest::setUp()
Change-Id: I598064cc7690f8dcc2fc5ef7a5d7c75935566d26
DiffHistoryBlobTest::testMediaWikiTestCaseParentSetupCalled
 DiffHistoryBlobTest::setUp() must call parent::setUp()
2012-12-06 17:22:18 +01:00
Timo Tijhof
181c7cdc8e Clean and repair many phpunit tests (+ fix implied configuration)
This commit depends on the introduction of
MediaWikiTestCase::setMwGlobals in change Iccf6ea81f4.

Various tests already set their globals, but forgot to restore
them afterwards, or forgot to call the parent setUp, tearDown...

Either way they won't have to anymore with setMwGlobals.

Consistent use of function characteristics:
* protected function setUp
* protected function tearDown
* public static function (provide..)

(Matching the function signature with PHPUnit/Framework/TestCase.php)

Replaces:
 * public function (setUp|tearDown)\(
 * protected function $1(

 * \tfunction (setUp|tearDown)\(
 * \tprotected function $1(

 * \tfunction (data|provide)\(
 * \tpublic static function $1\(

Also renamed a few "data#", "provider#" and "provides#" functions
to "provide#" for consistency. This also removes confusion where
the /media tests had a few private methods called dataFile(),
which were sometimes expected to be data providers.

Fixes:

TimestampTest often failed due to a previous test setting a
different language (it tests "1 hour ago" so need to make sure
it is set to English).

MWNamespaceTest became a lot cleaner now that it executes with
a known context. Though the now-redundant code that was removed
didn't work anyway because wgContentNamespaces isn't keyed by
namespace id, it had them was values...

FileBackendTest:
* Fixed: "PHP Fatal: Using $this when not in object context"

HttpTest
* Added comment about:
  "PHP Fatal: Call to protected MWHttpRequest::__construct()"
  (too much unrelated code to fix in this commit)

ExternalStoreTest
* Add an assertTrue as well, without it the test is useless
  because regardless of whether wgExternalStores is true or false
  it only uses it if it is an array.

Change-Id: I9d2b148e57bada64afeb7d5a99bec0e58f8e1561
2012-10-09 03:01:51 +02:00
Platonides
f13819e5be xdiff_string_rabdiff() appeared in version 1.5.0 of xdiff extension.
PHP manual saying PECL xdiff >= 0.2.0 is wrong.
Follow-up to r111701
2012-02-20 16:03:40 +00:00
Tim Starling
e1ee5c469b (bug 34428) Fixed hash mismatch errors in DiffHistoryBlob::patch() by simulating LibXDiff's broken Adler-32 implementation. 2012-02-16 23:27:00 +00:00