Commit graph

9 commits

Author SHA1 Message Date
Daimona Eaytoy
2b37cfaf18 build: Bump mediawiki-codesniffer to 31.0.0
Done with `composer fix` and suppressing the rest (i.e. sniffs for
global variables, which for core should be suppressed anyway).

Additionally, add `-p` to `phpcbf`, as otherwise it just seems stuck.

Change-Id: Ide8d6cdd083655891b6d654e78440fbda81ab2bc
2020-05-30 14:56:28 +00:00
Thiemo Kreuz
6b2c9deef5 Replace all new stdClass() with identical (object)[]
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
2020-03-04 21:18:30 +00:00
Thiemo Kreuz
e1dd371e11 Make use of PHPUnit's assertCount feature where possible
… and avoid assertEmpty() on arrays, in favor of a much more strict
assertSame( [] ).

Change-Id: I20266b0b1fc38a3a87666ba1b0793cb2b37d94a9
2020-03-02 15:58:41 +00:00
James D. Forrester
5e9fca47b9 Coding style: Auto-fix MediaWiki.Usage.PHPUnit*
Change-Id: I86fc55a4fc8ceafe368692173211bbcd6d8581d7
2020-01-10 10:17:12 +00:00
Aryeh Gregor
84cf385db0 Deprecate FileJournal::factory
Instead, the constructors for FileJournal and NullFileJournal should be
treated as stable. I would have added @stable, but our linting doesn't
recognize it yet and doesn't let.

Bug: T235066
Change-Id: I7741055b4f00197d1346ebbfebc14f20238a06f3
2019-11-04 15:17:56 +01:00
jenkins-bot
1bc7bc958c Merge "tests: Add explicit return type void to setUp() and tearDown()" 2019-11-01 02:08:24 +00:00
Max Semenik
48a323f702 tests: Add explicit return type void to setUp() and tearDown()
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
2019-10-30 14:31:22 -07:00
Aryeh Gregor
77cceb644a 100% unit test coverage for FileBackend
Bug: T234227
Change-Id: I2bfd975e9af78f4ee792d024ad7c1dd06902a284
2019-10-30 13:32:29 +02:00
Aryeh Gregor
c250d07bac Unit tests for FileBackend
Currently 62.79% coverage, 108/172 lines.

One oddity discovered during testing was that the "quick" variants of
most methods don't have an $opts parameter. It seems like just an
oversight, so I added it.

Bug: T234227
Change-Id: If2978065392cd6dcf693a588bb1ce6b5d43828f2
2019-10-30 09:35:13 +02:00
Renamed from tests/phpunit/includes/filebackend/FileBackendTest.php (Browse further)