Commit graph

6 commits

Author SHA1 Message Date
Timo Tijhof
8d406bbcd6 phpcs: Disable Generic.Files.LineLength for test files
There is a common and reasonable need for longer lines in tests.
The nudge for shorter lines doesn't seem valuable here. The natural
breaks will likely still fall in 80-100 given the enforced practice
for non-test code, e.g. whether through habit, or 80-100 column markers
in text editors, or the finite width of diff and code review
interfaces.

Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
2022-02-18 18:32:05 +00:00
Tim Starling
bb9a442be9 Add per-table straight join option
Add support for MySQL's per-table syntax for straight joins, which is
a join type analogous to LEFT JOIN.

SelectQueryBuilder::straightJoin() previously enabled the whole-query
straight join option, but it makes more sense for it to work analogously
with leftJoin(). So I renamed the existing method to
straightJoinOption(). No callers found in CodeSearch.

The motivation is to allow us to prevent reordering of the change_tag
join without affecting the rest of the recentchanges query.

Bug: T298225
Change-Id: I2bfcffc2bf9a64f23afdea0dfaccf89938896e62
2022-01-07 13:26:25 +11:00
Tim Starling
bd3689570d SelectQueryBuilder: conflicting conditions should be passed through
If where() is called multiple times with the same key in the array,
don't overwrite the previous condition value. Instead, append a
condition which will typically prevent the query from matching any
rows.

Bug: T288882
Change-Id: I67da6e818b0b9a71f87dd4ca94bc6939cf0bfe94
2021-08-31 09:51:15 +10:00
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
Kunal Mehta
e5b85ae8f9 tests: Fix invalid @covers tags
And use the MediaWikiCoversValidator trait to ensure we don't regress.

Change-Id: I60a75eaf7b6b2606355e1f549050f7b0b8a990b9
2021-01-22 12:45:24 -08:00
DannyS712
6a93b0ca93 More misc test cleanup
* parent::setUp() should be first, and ::tearDown()
  should be last
* Move tests that directly extend PHPUnit\Framework\TestCase
  to /unit

Change-Id: I1172855c58f4f52a8f624e6d596ec43beb8c93ff
2020-12-24 00:52:06 +00:00
Renamed from tests/phpunit/includes/libs/rdbms/querybuilder/SelectQueryBuilderTest.php (Browse further)