mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-14 10:04:52 +00:00
Merge "Don't force the "view" flavor when using stashing!"
This commit is contained in:
commit
0a28512624
|
@ -85,7 +85,9 @@ class DirectParsoidClient implements ParsoidClient {
|
||||||
$helper->init( $page, [], $user, $revision );
|
$helper->init( $page, [], $user, $revision );
|
||||||
|
|
||||||
$helper->setStashingEnabled( $stash );
|
$helper->setStashingEnabled( $stash );
|
||||||
|
if ( !$stash ) {
|
||||||
$helper->setFlavor( $flavor );
|
$helper->setFlavor( $flavor );
|
||||||
|
}
|
||||||
|
|
||||||
if ( $revision ) {
|
if ( $revision ) {
|
||||||
$helper->setRevision( $revision );
|
$helper->setRevision( $revision );
|
||||||
|
|
|
@ -195,6 +195,11 @@ class DirectParsoidClientTest extends MediaWikiIntegrationTestCase {
|
||||||
$oldHtml = $pageHtmlResponse['body'];
|
$oldHtml = $pageHtmlResponse['body'];
|
||||||
$updatedHtml = str_replace( '</body>', '<p>More Text</p></body>', $oldHtml );
|
$updatedHtml = str_replace( '</body>', '<p>More Text</p></body>', $oldHtml );
|
||||||
|
|
||||||
|
// Make sure the etag is for "stash" flavor HTML.
|
||||||
|
// The ETag should be transparent, but this is the easiest way to check that we are getting
|
||||||
|
// the correct flavor of HTML.
|
||||||
|
$this->assertMatchesRegularExpression( '@/stash\b@', $eTag );
|
||||||
|
|
||||||
// Now make a new client object, so we can mock the ParsoidOutputAccess.
|
// Now make a new client object, so we can mock the ParsoidOutputAccess.
|
||||||
$parsoidOutputAccess = $this->createNoOpMock( ParsoidOutputAccess::class );
|
$parsoidOutputAccess = $this->createNoOpMock( ParsoidOutputAccess::class );
|
||||||
$services = $this->getServiceContainer();
|
$services = $this->getServiceContainer();
|
||||||
|
|
Loading…
Reference in a new issue