@@ -32,28 +32,30 @@ $helper->method_matches_with_output($options, 'IsOpaque', false);
32
32
$ helper ->space ();
33
33
34
34
35
- $ obj = new V8 \ScriptOrigin ('test ' , 1 , 2 , true , 3 , 'map ' , true );
36
- //
37
- //$helper->header('Object representation');
38
- //$helper->dump($obj);
39
- //$helper->space();
40
- //
41
- //$helper->header('Test getters');
42
- //
43
- //$helper->method_matches_with_output($obj, 'ResourceName', 'test');
44
- //$helper->method_matches_with_output($obj, 'ResourceLineOffset', 1);
45
- //$helper->method_matches_with_output($obj, 'ResourceColumnOffset', 2);
46
- //$helper->method_matches_with_output($obj, 'ScriptID', 3);
47
- //$helper->method_matches_with_output($obj, 'SourceMapUrl', 'map');
48
- //$helper->method_matches_instanceof($obj, 'Options', V8\ScriptOriginOptions::class);
49
- //$helper->space();
50
- //
51
- //$options = $obj->Options();
52
- //
53
- //$helper->header('Test options getters');
54
- //$helper->method_matches_with_output($options, 'IsSharedCrossOrigin', true);
55
- //$helper->method_matches_with_output($options, 'IsOpaque', true);
56
- //$helper->space();
35
+ $ obj = new V8 \ScriptOrigin ('test ' , 1 , 2 , true , 3 , 'map ' , true , true , true );
36
+
37
+ $ helper ->header ('Object representation ' );
38
+ $ helper ->dump ($ obj );
39
+ $ helper ->space ();
40
+
41
+ $ helper ->header ('Test getters ' );
42
+
43
+ $ helper ->method_matches_with_output ($ obj , 'ResourceName ' , 'test ' );
44
+ $ helper ->method_matches_with_output ($ obj , 'ResourceLineOffset ' , 1 );
45
+ $ helper ->method_matches_with_output ($ obj , 'ResourceColumnOffset ' , 2 );
46
+ $ helper ->method_matches_with_output ($ obj , 'ScriptID ' , 3 );
47
+ $ helper ->method_matches_with_output ($ obj , 'SourceMapUrl ' , 'map ' );
48
+ $ helper ->method_matches_instanceof ($ obj , 'Options ' , V8 \ScriptOriginOptions::class);
49
+ $ helper ->space ();
50
+
51
+ $ options = $ obj ->Options ();
52
+
53
+ $ helper ->header ('Test options getters ' );
54
+ $ helper ->method_matches_with_output ($ options , 'IsSharedCrossOrigin ' , true );
55
+ $ helper ->method_matches_with_output ($ options , 'IsOpaque ' , true );
56
+ $ helper ->method_matches_with_output ($ options , 'IsWasm ' , true );
57
+ $ helper ->method_matches_with_output ($ options , 'IsModule ' , true );
58
+ $ helper ->space ();
57
59
58
60
?>
59
61
--EXPECT--
@@ -98,3 +100,48 @@ Test options getters (default):
98
100
-------------------------------
99
101
V8\ScriptOriginOptions::IsSharedCrossOrigin() matches expected false
100
102
V8\ScriptOriginOptions::IsOpaque() matches expected false
103
+
104
+
105
+ Object representation:
106
+ ----------------------
107
+ object(V8\ScriptOrigin)#4 (6) {
108
+ ["resource_name":"V8\ScriptOrigin":private]=>
109
+ string(4) "test"
110
+ ["resource_line_offset":"V8\ScriptOrigin":private]=>
111
+ int(1)
112
+ ["resource_column_offset":"V8\ScriptOrigin":private]=>
113
+ int(2)
114
+ ["options":"V8\ScriptOrigin":private]=>
115
+ object(V8\ScriptOriginOptions)#5 (4) {
116
+ ["is_shared_cross_origin":"V8\ScriptOriginOptions":private]=>
117
+ bool(true)
118
+ ["is_opaque":"V8\ScriptOriginOptions":private]=>
119
+ bool(true)
120
+ ["is_wasm":"V8\ScriptOriginOptions":private]=>
121
+ bool(true)
122
+ ["is_module":"V8\ScriptOriginOptions":private]=>
123
+ bool(true)
124
+ }
125
+ ["script_id":"V8\ScriptOrigin":private]=>
126
+ int(3)
127
+ ["source_map_url":"V8\ScriptOrigin":private]=>
128
+ string(3) "map"
129
+ }
130
+
131
+
132
+ Test getters:
133
+ -------------
134
+ V8\ScriptOrigin::ResourceName() matches expected 'test'
135
+ V8\ScriptOrigin::ResourceLineOffset() matches expected 1
136
+ V8\ScriptOrigin::ResourceColumnOffset() matches expected 2
137
+ V8\ScriptOrigin::ScriptID() matches expected 3
138
+ V8\ScriptOrigin::SourceMapUrl() matches expected 'map'
139
+ V8\ScriptOrigin::Options() result is instance of V8\ScriptOriginOptions
140
+
141
+
142
+ Test options getters:
143
+ ---------------------
144
+ V8\ScriptOriginOptions::IsSharedCrossOrigin() matches expected true
145
+ V8\ScriptOriginOptions::IsOpaque() matches expected true
146
+ V8\ScriptOriginOptions::IsWasm() matches expected true
147
+ V8\ScriptOriginOptions::IsModule() matches expected true
0 commit comments