|
|
@@ -7,36 +7,10 @@
|
|
|
|
|
|
/* global console:false */
|
|
|
|
|
|
-import moduleUtils from '/tests/_utils/module.js';
|
|
|
import EmitterMixin from '/ckeditor5/utils/emittermixin.js';
|
|
|
|
|
|
const utils = {
|
|
|
/**
|
|
|
- * Defines CKEditor plugin which is a mock of an editor creator.
|
|
|
- *
|
|
|
- * The mocked creator is available under:
|
|
|
- *
|
|
|
- * editor.plugins.get( 'creator-thename' );
|
|
|
- *
|
|
|
- * @param {String} creatorName Name of the creator.
|
|
|
- * @param {Object} [proto] Prototype of the creator. Properties from the proto param will
|
|
|
- * be copied to the prototype of the creator.
|
|
|
- */
|
|
|
- defineEditorCreatorMock( creatorName, proto ) {
|
|
|
- moduleUtils.define( 'creator-' + creatorName, [ 'creator' ], ( Creator ) => {
|
|
|
- class TestCreator extends Creator {}
|
|
|
-
|
|
|
- if ( proto ) {
|
|
|
- for ( let propName in proto ) {
|
|
|
- TestCreator.prototype[ propName ] = proto[ propName ];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return TestCreator;
|
|
|
- } );
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
* Returns the number of elements return by the iterator.
|
|
|
*
|
|
|
* testUtils.getIteratorCount( [ 1, 2, 3, 4, 5 ] ); // 5;
|