mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-13 17:48:17 +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 );
|
||||||
$helper->setFlavor( $flavor );
|
if ( !$stash ) {
|
||||||
|
$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