r92489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92488‎ | r92489 | r92490 >
Date:22:30, 18 July 2011
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Removed testBug29116LoadWithEmptyIp. Fails due to wfDeprecated() call in load() and nothing uses that so it's not worth it.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/BlockTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/BlockTest.php
@@ -83,25 +83,6 @@
8484 }
8585
8686 /**
87 - * This is the method previously used to load block info in CheckUser etc
88 - * passing an empty value (empty string, null, etc) as the ip parameter bypasses IP lookup checks.
89 - *
90 - * This stopped working with r84475 and friends: regression being fixed for bug 29116.
91 - *
92 - * @dataProvider dataBug29116
93 - */
94 - function testBug29116LoadWithEmptyIp( $vagueTarget ) {
95 - $uid = User::idFromName( 'UTBlockee' );
96 - $this->assertTrue( ($uid > 0), 'Must be able to look up the target user during tests' );
97 -
98 - $block = new Block();
99 - $ok = $block->load( $vagueTarget, $uid );
100 - $this->assertTrue( $ok, "Block->load() with empty IP and user ID '$uid' should return a block" );
101 -
102 - $this->assertTrue( $this->block->equals( $block ), "Block->load() returns the same block as the one that was made when given empty ip param " . var_export( $vagueTarget, true ) );
103 - }
104 -
105 - /**
10687 * CheckUser since being changed to use Block::newFromTarget started failing
10788 * because the new function didn't accept empty strings like Block::load()
10889 * had. Regression bug 29116.

Follow-up revisions

RevisionCommit summaryAuthorDate
r93058Reverted r92489 and added/use hideDeprecated() to MW test frameworkaaron16:27, 25 July 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   17:07, 19 July 2011

This test is there to confirm that we have the same behavior between the old and new code paths... even though something might be deprecated, it still needs to work so we should still be testing it.

If calling deprecated things on purpose breaks the tests, the test system needs fixing!

#Comment by 😂 (talk | contribs)   17:23, 19 July 2011

Nothing uses the old code path anymore afaict.

Status & tagging log