@@ -712,9 +712,9 @@ public function testRun()
712
712
);
713
713
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
714
714
$ this ->assertEquals (
715
- [ ' clean ' => [ ' bypass ' => 1 ]] ,
715
+ null ,
716
716
$ originCountItem ,
717
- 'The origin count for clean should be 1 '
717
+ 'The origin count for clean should be null '
718
718
);
719
719
720
720
// Test 3: bouncing URI
@@ -739,9 +739,9 @@ public function testRun()
739
739
$ this ->assertEquals (true , $ bouncer ->run (), 'Should bounce uri ' );
740
740
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
741
741
$ this ->assertEquals (
742
- ['clean ' => ['bypass ' => 2 ]],
742
+ ['clean ' => ['bypass ' => 1 ]],
743
743
$ originCountItem ,
744
- 'The origin count for clean should be 2 '
744
+ 'The origin count for clean should be 1 '
745
745
);
746
746
747
747
// Test 4: not bouncing URI if disabled
@@ -768,9 +768,9 @@ public function testRun()
768
768
$ this ->assertEquals (false , $ bouncer ->run (), 'Should not bounce if disabled ' );
769
769
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
770
770
$ this ->assertEquals (
771
- ['clean ' => ['bypass ' => 3 ]],
771
+ ['clean ' => ['bypass ' => 1 ]],
772
772
$ originCountItem ,
773
- 'The origin count for clean should be 3 '
773
+ 'The origin count for clean should still be 1 as we did not bounce at all due to config '
774
774
);
775
775
776
776
PHPUnitUtil::assertRegExp (
@@ -830,9 +830,9 @@ public function testRun()
830
830
);
831
831
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
832
832
$ this ->assertEquals (
833
- ['clean ' => ['bypass ' => 3 ]],
833
+ ['clean ' => ['bypass ' => 1 ]],
834
834
$ originCountItem ,
835
- 'The origin count for clean should be still 3 '
835
+ 'The origin count for clean should be still 1 '
836
836
);
837
837
838
838
// Test 6: NOT throw error if config says so
@@ -871,9 +871,9 @@ public function testRun()
871
871
}
872
872
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
873
873
$ this ->assertEquals (
874
- ['clean ' => ['bypass ' => 3 ]],
874
+ ['clean ' => ['bypass ' => 1 ]],
875
875
$ originCountItem ,
876
- 'The origin count for clean should be still 3 '
876
+ 'The origin count for clean should be still 1 '
877
877
);
878
878
879
879
$ this ->assertEquals ('' , $ error , 'Should not throw error ' );
@@ -919,9 +919,9 @@ public function testRun()
919
919
);
920
920
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
921
921
$ this ->assertEquals (
922
- ['clean ' => ['bypass ' => 4 ]],
922
+ ['clean ' => ['bypass ' => 2 ]],
923
923
$ originCountItem ,
924
- 'The origin count for clean should be 4 '
924
+ 'The origin count for clean should be 2 '
925
925
);
926
926
927
927
// Test 8 : forced X-Forwarded-for usage
@@ -959,9 +959,9 @@ public function testRun()
959
959
);
960
960
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
961
961
$ this ->assertEquals (
962
- ['clean ' => ['bypass ' => 5 ]],
962
+ ['clean ' => ['bypass ' => 3 ]],
963
963
$ originCountItem ,
964
- 'The origin count for clean should be 5 '
964
+ 'The origin count for clean should be 3 '
965
965
);
966
966
967
967
// Test 9 non-authorized
@@ -995,9 +995,9 @@ public function testRun()
995
995
);
996
996
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
997
997
$ this ->assertEquals (
998
- ['clean ' => ['bypass ' => 6 ]],
998
+ ['clean ' => ['bypass ' => 4 ]],
999
999
$ originCountItem ,
1000
- 'The origin count for clean should be 6 '
1000
+ 'The origin count for clean should be 4 '
1001
1001
);
1002
1002
1003
1003
// Test 10 authorized
@@ -1030,20 +1030,20 @@ public function testRun()
1030
1030
);
1031
1031
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
1032
1032
$ this ->assertEquals (
1033
- ['clean ' => ['bypass ' => 7 ]],
1033
+ ['clean ' => ['bypass ' => 5 ]],
1034
1034
$ originCountItem ,
1035
- 'The origin count for clean should be 7 '
1035
+ 'The origin count for clean should be 5 '
1036
1036
);
1037
1037
// Test 11: push metrics
1038
1038
$ result = $ bouncer ->pushUsageMetrics (self ::BOUNCER_NAME , self ::BOUNCER_VERSION , self ::BOUNCER_TYPE );
1039
1039
$ this ->assertEquals (
1040
1040
[
1041
1041
'name ' => 'processed ' ,
1042
- 'value ' => 7 ,
1042
+ 'value ' => 5 ,
1043
1043
'unit ' => 'request ' ,
1044
1044
],
1045
1045
$ result ['remediation_components ' ][0 ]['metrics ' ][0 ]['items ' ][0 ],
1046
- 'Should have pushed metrics '
1046
+ 'Should have pushed 5 processed metrics '
1047
1047
);
1048
1048
$ originCountItem = $ cache ->getItem (AbstractCache::ORIGINS_COUNT )->get ();
1049
1049
$ this ->assertEquals (
0 commit comments