aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/libs/GenericArrayObjectTest.php
Commit message (Collapse)AuthorAgeFilesLines
* site: Simplify SiteList by removing GenericArrayObject indirectionTimo Tijhof2023-06-051-278/+0
| | | | | | | | | | | | | | | | | | | | | | | | | == Background == In 2012, commit afe46f1403a (Id7e9b59c7e) added libs/GenericArrayObject along with an (unused) abstract GenericArrayObjectTest case. The same code was also added to the Wikibase extension with change 6347b35a55cd (Ifa7f1dc702). The code was then factored out from Wikibase into the wmde/Diff library. In 2013, GenericArrayObject was removed from wmde/Diff in the commit at https://github.com/wmde/Diff/commit/d9c2bd5c140e2a783fd42298db6c. == This change == Remove the GenericArrayObject indirection from SiteList as there exist nothing outside SiteList refering to it in Codesearch Everywhere, and even in SiteList much of the code in GenericArrayObject is overridden, unused, or otherwise needlessly indirect. Change-Id: Ifea09c5de50af1616058d8baa9037db273dfb0e5
* Just another 80 or so PHPStorm inspection fixes (#4)Tim Starling2023-03-251-1/+0
| | | | | | | | | | | | | * Unnecessary regex modifier. I agree with this inspection which flags /s modifiers on regexes that don't use a dot. * Property declared dynamically. * Unused local variable. But it's acceptable for an unused local variable to take the return value of a method under test, when it is being tested for its side-effects. And it's acceptable for an unused local variable to document unused list expansion elements, or the nature of array keys in a foreach. Change-Id: I067b5b45dd1138c00e7269b66d3d1385f202fe7f
* Tests: Mark more more closures as staticUmherirrender2021-02-091-2/+2
| | | | | | | Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208 Bug: T274036 Change-Id: I695873737167a75f0d94901fa40383a33984ca55
* build: Update mediawiki/mediawiki-codesniffer to 35.0.0Umherirrender2021-01-311-1/+1
| | | | Change-Id: Idb413be4b8cba8611afdc022af59810ce1a4531e
* Replace all call_user_func(_array) in all testsThiemo Kreuz2020-06-061-1/+1
| | | | | | | | | | | | | There is native support for all of this now in PHP, thanks to changes and additions that have been made in later versions. There should be no need any more to ever use call_user_func() or call_user_func_array(). Reviewing this should be fairly easy: Because this patch touches exclusivly tests, but no production code, there is no such thing as "insufficent test coverage". As long as CI goes green, this should be fine. Change-Id: Ib9690103687734bb5a85d3dab0e5642a07087bbc
* Replace all `new stdClass()` with identical `(object)[]`Thiemo Kreuz2020-03-041-1/+1
| | | | | | | | | | | | This should be the exact same. Its more a style change than anything. So why do it then? * I believe this is much less confusing than code mentioning a weird "standard class". Barely anybody knows what this is, and what the difference between "object" and "stdClass" is. * The code is shorter. * It's even faster. In my micro benchmark it's twice as fast. Change-Id: I7ee0e8ae6d9264a89b6cd1dd861f0466ae620ccc
* Revert "Separate MediaWiki unit and integration tests"Legoktm2019-06-131-0/+279
| | | | | | | | This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9. Reason for revert: Broke postgres tests. Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
* Separate MediaWiki unit and integration testsMáté Szabó2019-06-131-279/+0
| | | | | | | | | | | | | | | | | | | | | This changeset implements T89432 and related tickets and is based on exploration done at the Prague Hackathon. The goal is to identify tests in MediaWiki core that can be run without having to install & configure MediaWiki and its dependencies, and provide a way to execute these tests via the standard phpunit entry point, allowing for faster development and integration with existing tooling like IDEs. The initial set of tests that met these criteria were identified using the work Amir did in I88822667693d9e00ac3d4639c87bc24e5083e5e8. These tests were then moved into a new subdirectory under phpunit/ and organized into a separate test suite. The environment for this suite is set up via a PHPUnit bootstrap file without a custom entry point. You can execute these tests by running: $ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml Bug: T89432 Bug: T87781 Bug: T84948 Change-Id: Iad01033a0548afd4d2a6f2c1ef6fcc9debf72c0d
* Remove @dataProvider and @covers from non-test functionsUmherirrender2018-03-181-3/+1
| | | | | | Only functions beginning with test* should have that annotation Change-Id: I85cd795970205943aebe692d85434145b3cf3f5b
* build: Updating mediawiki/mediawiki-codesniffer to 16.0.0Umherirrender2018-02-171-1/+1
| | | | Change-Id: I59b59f79bbf3ce4feff3b3a20c1c31bc16370531
* Use MediaWikiCoversValidator for tests that don't use MediaWikiTestCaseKunal Mehta2018-01-011-0/+2
| | | | Change-Id: I8c4de7e9c72c9969088666007b54c6fd23f6cc13
* Convert all array() syntax to []Kunal Mehta2016-02-171-5/+5
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* tests: Clean up file headersTimo Tijhof2015-04-011-1/+0
| | | | | | | | | | * Remove redundant @licence/@license from test suite files. They already have full licence headers. And @licence raises a warning in Doxygen. * Fix weird messes of comments inside comments and other things. Change-Id: I38da8ca76330f72b8dc22b0ecf1ea69d5ea55ede
* Convert most libs/ tests to use PHPUnit_Framework_TestCaseChad Horohoe2014-12-291-1/+1
| | | | | | They don't actually need any of the mess that MediaWikiTestCase provides Change-Id: Ibd067480fc294096d1249132cb800e09889efb18
* Pass phpcs-strict on some test files (7/11)Siebrand Mazeland2014-04-241-1/+2
| | | | Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
* docs: closure -> Closure; callback -> callableumherirrender2014-04-191-1/+1
| | | | | | | Changed closure to capital word Closure in doc and type hint, also changed callback in docs to callable Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057
* @covers tags for unit testsaddshore2013-10-241-0/+16
| | | | Change-Id: I2b486b38326bf23bd379efba2142034e24c0745f
* Update code formattingSiebrand Mazeland2013-04-261-1/+2
| | | | Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
* Update formattingSiebrand Mazeland2013-02-151-7/+5
| | | | | | 5 of n. Change-Id: I811ca957b6588085d67606ebc0cd4033a1e53839
* pass codesniffer on tests/Antoine Musso2013-01-281-2/+2
| | | | | | | | | | | | | | | 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
* Fixed SiteArray serializationjeroendedauw2012-12-121-0/+20
| | | | Change-Id: I9844236b8720d96f99aef788ab023c522f993045
* Remove the \ before the class name.Platonides2012-12-111-1/+1
| | | | | | | Then 'stdclass' is preceded by T_NEW and taken as a class name. Else it was misinterpreted as a function call. Change-Id: Ib6afccb26e530a24bf7414ede10f573a9934d2ed
* Remove broken test.jeroendedauw2012-12-081-5/+4
| | | | | | | | Calling the method does not raise an exception but a notice (depending on settings). PHPUnit just happens to turn this into an exception. The test thus breaks if PHPUnit does not do this, which apparently happens in some cases and caused bug 41491 Change-Id: I9d14fd875c70c8b3d164c0b8a4fa2667c5769682
* Added sites functionality, a much more generic and flexible version of the ↵jeroendedauw2012-10-121-1/+1
| | | | | | | | existing interwiki code This code is meant to replace the current interwiki code, but does not do so just yet. It is however used by the Wikibase extension. This allows us to try out some more things and have the code stabilize more before we migrate over existing interwiki functionality. Change-Id: I23c47c2c3909a1500350fb560a5f2ec654e2c37e
* Added default implmentation of instanceProvider to GenericArrayObjectTestjeroendedauw2012-08-291-6/+14
| | | | Change-Id: I8d77c03b90ddca226c4bff18e42c53980bf9a861
* use InvalidArgumentException rather then Exceptionjeroendedauw2012-08-271-1/+1
| | | | Change-Id: Ie744c773b316278e4a92af28354a8fe4eb83b78f
* Fix type of exception no longer matching after someone changed it without ↵jeroendedauw2012-08-241-2/+1
| | | | | | running the tests... Change-Id: I5b1c3556f40d869f0f5d4a617f01f981d607d11f
* Added GenericArrayObject class and associated test basejeroendedauw2012-08-131-0/+238
Change-Id: Id7e9b59c7ed4a9338744db58935307ecb4bc441f