phptest 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.1",
2
+ "version": "0.0.2",
3
3
  "name": "phptest",
4
4
  "description": "Test helper library for PHP core runtime components",
5
5
  "keywords": [
@@ -31,10 +31,12 @@
31
31
  "regexp.escape": "^1.1.0",
32
32
  "source-map": "^0.7.3"
33
33
  },
34
+ "devDependencies": {
35
+ "phpcore": "^7.1.0"
36
+ },
34
37
  "peerDependencies": {
35
38
  "core-js-pure": "^3.21.1",
36
39
  "mocha": "^9.2.2",
37
- "phpcore": "^7.1.0",
38
40
  "phptoast": "^9.0.1",
39
41
  "phptojs": "^9.0.0"
40
42
  },
@@ -13,27 +13,30 @@ var _ = require('microdash'),
13
13
  escapeRegex = require('regexp.escape'),
14
14
  path = require('path'),
15
15
  mochaPath = path.dirname(require.resolve('mocha/package.json')),
16
- phpCorePath = path.resolve(__dirname, '../..'),
17
16
  phpToAST = require('phptoast'),
18
17
  phpToJS = require('phptojs'),
19
18
  util = require('util'),
20
- OpcodeExecutor = require('phpcore/src/Core/Opcode/Handler/OpcodeExecutor'),
21
- Reference = require('../../src/Reference/Reference'),
22
19
  SourceMapConsumer = require('source-map').SourceMapConsumer,
23
- Value = require('../../src/Value').sync(),
24
- Variable = require('../../src/Variable').sync(),
25
- WeakMap = require('es6-weak-map'),
26
- runtimeFactory = require('../../src/shared/runtimeFactory');
20
+ WeakMap = require('es6-weak-map');
27
21
 
28
22
  /**
29
23
  * Creates an integration test helper tools object.
30
24
  *
31
- * @param {Function} initRuntime
25
+ * @param {string} phpCorePath
26
+ * @param {Function=} initRuntime
32
27
  * @returns {Object}
33
28
  */
34
- module.exports = function (initRuntime) {
35
- // A map that allows looking up the source map data for a module later on
36
- var moduleDataMap = new WeakMap(),
29
+ module.exports = function (phpCorePath, initRuntime) {
30
+ var
31
+ OpcodeExecutor = require(phpCorePath + '/src/Core/Opcode/Handler/OpcodeExecutor'),
32
+ Reference = require(phpCorePath + '/src/Reference/Reference'),
33
+ Value = require(phpCorePath + '/src/Value').sync(),
34
+ Variable = require(phpCorePath + '/src/Variable').sync(),
35
+ runtimeFactory = require(phpCorePath + '/src/shared/runtimeFactory'),
36
+
37
+ // A map that allows looking up the source map data for a module later on.
38
+ moduleDataMap = new WeakMap(),
39
+
37
40
  /**
38
41
  * Creates a Runtime with the given mode.
39
42
  *