dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28d21be
)
Editing unit tests: set title in context
author
Max Semenik
<maxsem.wiki@gmail.com>
Thu, 17 Jul 2014 22:28:46 +0000
(15:28 -0700)
committer
Ori.livneh
<ori@wikimedia.org>
Thu, 17 Jul 2014 23:59:00 +0000
(23:59 +0000)
It is assumed that users of EditFilterMergedContent hook need to get
the page being edited from context as it happens during normal functioning,
tests shouldn't violate this convention.
Bug: 66930
Change-Id: I8d453d819aad8630d4934a15e7bf512fa828fe24
tests/phpunit/includes/EditPageTest.php
patch
|
blob
|
history
diff --git
a/tests/phpunit/includes/EditPageTest.php
b/tests/phpunit/includes/EditPageTest.php
index
3c653b4
..
6b8bf27
100644
(file)
--- a/
tests/phpunit/includes/EditPageTest.php
+++ b/
tests/phpunit/includes/EditPageTest.php
@@
-96,6
+96,7
@@
class EditPageTest extends MediaWikiLangTestCase {
$ns = $this->getDefaultWikitextNS();
$title = Title::newFromText( $title, $ns );
}
+ $this->assertNotNull( $title );
if ( is_string( $user ) ) {
$user = User::newFromName( $user );
@@
-141,7
+142,9
@@
class EditPageTest extends MediaWikiLangTestCase {
$req = new FauxRequest( $edit, true ); // session ??
- $ep = new EditPage( new Article( $title ) );
+ $article = new Article( $title );
+ $article->getContext()->setTitle( $title );
+ $ep = new EditPage( $article );
$ep->setContextTitle( $title );
$ep->importFormData( $req );