@@ -9,48 +9,48 @@ import 'package:angular/utils.dart' as utils;
9
9
10
10
11
11
class _MockXhr {
12
- var $$ method, $$ url, $$ async, $$ reqHeaders, $$ respHeaders;
12
+ var method, url, async , reqHeaders, respHeaders;
13
13
14
14
void open (method, url, async ) {
15
- $$ method = method;
16
- $$ url = url;
17
- $$ async = async ;
18
- $$ reqHeaders = {};
19
- $$ respHeaders = {};
15
+ this . method = method;
16
+ this . url = url;
17
+ this . async = async ;
18
+ reqHeaders = {};
19
+ respHeaders = {};
20
20
}
21
21
22
- var $$ data;
22
+ var data;
23
23
24
24
void send (data) {
25
- $$ data = data;
25
+ data = data;
26
26
}
27
27
28
28
void setRequestHeader (key, value) {
29
- $$ reqHeaders[key] = value;
29
+ reqHeaders[key] = value;
30
30
}
31
31
32
32
String getResponseHeader (name) {
33
33
// the lookup must be case insensitive, that's why we try two quick
34
34
// lookups and full scan at last
35
- if ($$ respHeaders.containsKey (name)) return $$ respHeaders[name];
35
+ if (respHeaders.containsKey (name)) return respHeaders[name];
36
36
37
37
name = name.toLowerCase ();
38
- if ($$ respHeaders.containsKey (name)) return $$ respHeaders[name];
38
+ if (respHeaders.containsKey (name)) return respHeaders[name];
39
39
40
40
String header = null ;
41
- $$ respHeaders.forEach ((headerName, headerVal) {
41
+ respHeaders.forEach ((headerName, headerVal) {
42
42
if (header != null ) return ;
43
43
if (headerName.toLowerCase ()) header = headerVal;
44
44
});
45
45
return header;
46
46
}
47
47
48
48
getAllResponseHeaders () {
49
- if ($$ respHeaders == null ) return '' ;
49
+ if (respHeaders == null ) return '' ;
50
50
51
51
var lines = [];
52
52
53
- $$ respHeaders.forEach ((key, value) {
53
+ respHeaders.forEach ((key, value) {
54
54
lines.add ("$key : $value " );
55
55
});
56
56
return lines.join ('\n ' );
@@ -177,7 +177,7 @@ class MockHttpBackend implements HttpBackend {
177
177
var wrapResponse = (wrapped) {
178
178
var handleResponse = () {
179
179
var response = wrapped.response (method, url, data, headers);
180
- xhr.$$ respHeaders = response[2 ];
180
+ xhr.respHeaders = response[2 ];
181
181
utils.relaxFnApply (callback, [response[0 ], response[1 ],
182
182
xhr.getAllResponseHeaders ()]);
183
183
};
@@ -260,8 +260,8 @@ class MockHttpBackend implements HttpBackend {
260
260
261
261
/**
262
262
* @ngdoc method
263
- * @name ngMock.$ httpBackend#whenGET
264
- * @methodOf ngMock.$ httpBackend
263
+ * @name ngMock.httpBackend#whenGET
264
+ * @methodOf ngMock.httpBackend
265
265
* @description
266
266
* Creates a new backend definition for GET requests. For more info see `when()` .
267
267
*
@@ -274,8 +274,8 @@ class MockHttpBackend implements HttpBackend {
274
274
275
275
/**
276
276
* @ngdoc method
277
- * @name ngMock.$ httpBackend#whenDELETE
278
- * @methodOf ngMock.$ httpBackend
277
+ * @name ngMock.httpBackend#whenDELETE
278
+ * @methodOf ngMock.httpBackend
279
279
* @description
280
280
* Creates a new backend definition for DELETE requests. For more info see `when()` .
281
281
*
@@ -288,8 +288,8 @@ class MockHttpBackend implements HttpBackend {
288
288
289
289
/**
290
290
* @ngdoc method
291
- * @name ngMock.$ httpBackend#whenJSONP
292
- * @methodOf ngMock.$ httpBackend
291
+ * @name ngMock.httpBackend#whenJSONP
292
+ * @methodOf ngMock.httpBackend
293
293
* @description
294
294
* Creates a new backend definition for JSONP requests. For more info see `when()` .
295
295
*
@@ -301,8 +301,8 @@ class MockHttpBackend implements HttpBackend {
301
301
302
302
/**
303
303
* @ngdoc method
304
- * @name ngMock.$ httpBackend#whenPUT
305
- * @methodOf ngMock.$ httpBackend
304
+ * @name ngMock.httpBackend#whenPUT
305
+ * @methodOf ngMock.httpBackend
306
306
* @description
307
307
* Creates a new backend definition for PUT requests. For more info see `when()` .
308
308
*
@@ -316,8 +316,8 @@ class MockHttpBackend implements HttpBackend {
316
316
317
317
/**
318
318
* @ngdoc method
319
- * @name ngMock.$ httpBackend#whenPOST
320
- * @methodOf ngMock.$ httpBackend
319
+ * @name ngMock.httpBackend#whenPOST
320
+ * @methodOf ngMock.httpBackend
321
321
* @description
322
322
* Creates a new backend definition for POST requests. For more info see `when()` .
323
323
*
@@ -333,8 +333,8 @@ class MockHttpBackend implements HttpBackend {
333
333
334
334
/**
335
335
* @ngdoc method
336
- * @name ngMock.$ httpBackend#whenHEAD
337
- * @methodOf ngMock.$ httpBackend
336
+ * @name ngMock.httpBackend#whenHEAD
337
+ * @methodOf ngMock.httpBackend
338
338
* @description
339
339
* Creates a new backend definition for HEAD requests. For more info see `when()` .
340
340
*
@@ -346,8 +346,8 @@ class MockHttpBackend implements HttpBackend {
346
346
347
347
/**
348
348
* @ngdoc method
349
- * @name ngMock.$ httpBackend#expect
350
- * @methodOf ngMock.$ httpBackend
349
+ * @name ngMock.httpBackend#expect
350
+ * @methodOf ngMock.httpBackend
351
351
* @description
352
352
* Creates a new request expectation.
353
353
*
@@ -375,8 +375,8 @@ class MockHttpBackend implements HttpBackend {
375
375
376
376
/**
377
377
* @ngdoc method
378
- * @name ngMock.$ httpBackend#expectGET
379
- * @methodOf ngMock.$ httpBackend
378
+ * @name ngMock.httpBackend#expectGET
379
+ * @methodOf ngMock.httpBackend
380
380
* @description
381
381
* Creates a new request expectation for GET requests. For more info see `expect()` .
382
382
*
@@ -389,8 +389,8 @@ class MockHttpBackend implements HttpBackend {
389
389
390
390
/**
391
391
* @ngdoc method
392
- * @name ngMock.$ httpBackend#expectDELETE
393
- * @methodOf ngMock.$ httpBackend
392
+ * @name ngMock.httpBackend#expectDELETE
393
+ * @methodOf ngMock.httpBackend
394
394
* @description
395
395
* Creates a new request expectation for DELETE requests. For more info see `expect()` .
396
396
*
@@ -403,8 +403,8 @@ class MockHttpBackend implements HttpBackend {
403
403
404
404
/**
405
405
* @ngdoc method
406
- * @name ngMock.$ httpBackend#expectJSONP
407
- * @methodOf ngMock.$ httpBackend
406
+ * @name ngMock.httpBackend#expectJSONP
407
+ * @methodOf ngMock.httpBackend
408
408
* @description
409
409
* Creates a new request expectation for JSONP requests. For more info see `expect()` .
410
410
*
@@ -416,8 +416,8 @@ class MockHttpBackend implements HttpBackend {
416
416
417
417
/**
418
418
* @ngdoc method
419
- * @name ngMock.$ httpBackend#expectPUT
420
- * @methodOf ngMock.$ httpBackend
419
+ * @name ngMock.httpBackend#expectPUT
420
+ * @methodOf ngMock.httpBackend
421
421
* @description
422
422
* Creates a new request expectation for PUT requests. For more info see `expect()` .
423
423
*
@@ -431,8 +431,8 @@ class MockHttpBackend implements HttpBackend {
431
431
432
432
/**
433
433
* @ngdoc method
434
- * @name ngMock.$ httpBackend#expectPOST
435
- * @methodOf ngMock.$ httpBackend
434
+ * @name ngMock.httpBackend#expectPOST
435
+ * @methodOf ngMock.httpBackend
436
436
* @description
437
437
* Creates a new request expectation for POST requests. For more info see `expect()` .
438
438
*
@@ -446,8 +446,8 @@ class MockHttpBackend implements HttpBackend {
446
446
447
447
/**
448
448
* @ngdoc method
449
- * @name ngMock.$ httpBackend#expectPATCH
450
- * @methodOf ngMock.$ httpBackend
449
+ * @name ngMock.httpBackend#expectPATCH
450
+ * @methodOf ngMock.httpBackend
451
451
* @description
452
452
* Creates a new request expectation for PATCH requests. For more info see `expect()` .
453
453
*
@@ -461,8 +461,8 @@ class MockHttpBackend implements HttpBackend {
461
461
462
462
/**
463
463
* @ngdoc method
464
- * @name ngMock.$ httpBackend#expectHEAD
465
- * @methodOf ngMock.$ httpBackend
464
+ * @name ngMock.httpBackend#expectHEAD
465
+ * @methodOf ngMock.httpBackend
466
466
* @description
467
467
* Creates a new request expectation for HEAD requests. For more info see `expect()` .
468
468
*
@@ -474,8 +474,8 @@ class MockHttpBackend implements HttpBackend {
474
474
475
475
/**
476
476
* @ngdoc method
477
- * @name ngMock.$ httpBackend#flush
478
- * @methodOf ngMock.$ httpBackend
477
+ * @name ngMock.httpBackend#flush
478
+ * @methodOf ngMock.httpBackend
479
479
* @description
480
480
* Flushes all pending requests using the trained responses.
481
481
*
@@ -502,8 +502,8 @@ class MockHttpBackend implements HttpBackend {
502
502
503
503
/**
504
504
* @ngdoc method
505
- * @name ngMock.$ httpBackend#verifyNoOutstandingExpectation
506
- * @methodOf ngMock.$ httpBackend
505
+ * @name ngMock.httpBackend#verifyNoOutstandingExpectation
506
+ * @methodOf ngMock.httpBackend
507
507
* @description
508
508
* Verifies that all of the requests defined via the `expect` api were made. If any of the
509
509
* requests were not made, verifyNoOutstandingExpectation throws an exception.
@@ -512,7 +512,7 @@ class MockHttpBackend implements HttpBackend {
512
512
* "afterEach" clause.
513
513
*
514
514
* <pre>
515
- * afterEach($ httpBackend.verifyNoOutstandingExpectation);
515
+ * afterEach(httpBackend.verifyNoOutstandingExpectation);
516
516
* </pre>
517
517
*/
518
518
void verifyNoOutstandingExpectation () {
@@ -524,16 +524,16 @@ class MockHttpBackend implements HttpBackend {
524
524
525
525
/**
526
526
* @ngdoc method
527
- * @name ngMock.$ httpBackend#verifyNoOutstandingRequest
528
- * @methodOf ngMock.$ httpBackend
527
+ * @name ngMock.httpBackend#verifyNoOutstandingRequest
528
+ * @methodOf ngMock.httpBackend
529
529
* @description
530
530
* Verifies that there are no outstanding requests that need to be flushed.
531
531
*
532
532
* Typically, you would call this method following each test case that asserts requests using an
533
533
* "afterEach" clause.
534
534
*
535
535
* <pre>
536
- * afterEach($ httpBackend.verifyNoOutstandingRequest);
536
+ * afterEach(httpBackend.verifyNoOutstandingRequest);
537
537
* </pre>
538
538
*/
539
539
void verifyNoOutstandingRequest () {
@@ -543,12 +543,12 @@ class MockHttpBackend implements HttpBackend {
543
543
544
544
/**
545
545
* @ngdoc method
546
- * @name ngMock.$ httpBackend#resetExpectations
547
- * @methodOf ngMock.$ httpBackend
546
+ * @name ngMock.httpBackend#resetExpectations
547
+ * @methodOf ngMock.httpBackend
548
548
* @description
549
549
* Resets all request expectations, but preserves all backend definitions. Typically, you would
550
550
* call resetExpectations during a multiple-phase test when you want to reuse the same instance of
551
- * $ httpBackend mock.
551
+ * httpBackend mock.
552
552
*/
553
553
void resetExpectations () {
554
554
expectations.length = 0 ;
0 commit comments