@@ -863,56 +863,56 @@ public function testSetBadSegmentSilent()
863
863
864
864
public function testBasedNoIndex ()
865
865
{
866
- $ this ->resetServices ();
867
-
868
866
$ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
869
867
$ _SERVER ['REQUEST_URI ' ] = '/ci/v4/controller/method ' ;
870
868
869
+ $ this ->resetServices ();
870
+
871
871
$ config = new App ();
872
- $ config ->baseURL = 'http://example.com/ci/v4 ' ;
873
- $ config ->indexPage = 'index.php ' ;
874
- $ request = Services::request ($ config );
875
- $ request ->uri = new URI ('http://example.com/ci/v4/controller/method ' );
872
+ $ config ->baseURL = 'http://example.com/ci/v4/ ' ;
873
+ $ config ->indexPage = '' ;
874
+ Factories::injectMock ('config ' , 'App ' , $ config );
876
875
876
+ $ request = Services::request ($ config );
877
877
Services::injectMock ('request ' , $ request );
878
878
879
879
// going through request
880
880
$ this ->assertSame ('http://example.com/ci/v4/controller/method ' , (string ) $ request ->getUri ());
881
- $ this ->assertSame ('/ ci/v4/controller/method ' , $ request ->getUri ()->getPath ());
881
+ $ this ->assertSame ('ci/v4/controller/method ' , $ request ->getUri ()->getPath ());
882
882
883
883
// standalone
884
884
$ uri = new URI ('http://example.com/ci/v4/controller/method ' );
885
885
$ this ->assertSame ('http://example.com/ci/v4/controller/method ' , (string ) $ uri );
886
886
$ this ->assertSame ('/ci/v4/controller/method ' , $ uri ->getPath ());
887
887
888
- $ this ->assertSame ($ uri ->getPath (), $ request ->getUri ()->getPath ());
888
+ $ this ->assertSame ($ uri ->getPath (), ' / ' . $ request ->getUri ()->getPath ());
889
889
}
890
890
891
891
public function testBasedWithIndex ()
892
892
{
893
- $ this ->resetServices ();
894
-
895
893
$ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
896
894
$ _SERVER ['REQUEST_URI ' ] = '/ci/v4/index.php/controller/method ' ;
897
895
896
+ $ this ->resetServices ();
897
+
898
898
$ config = new App ();
899
- $ config ->baseURL = 'http://example.com/ci/v4 ' ;
899
+ $ config ->baseURL = 'http://example.com/ci/v4/ ' ;
900
900
$ config ->indexPage = 'index.php ' ;
901
- $ request = Services::request ($ config );
902
- $ request ->uri = new URI ('http://example.com/ci/v4/index.php/controller/method ' );
901
+ Factories::injectMock ('config ' , 'App ' , $ config );
903
902
903
+ $ request = Services::request ($ config );
904
904
Services::injectMock ('request ' , $ request );
905
905
906
906
// going through request
907
907
$ this ->assertSame ('http://example.com/ci/v4/index.php/controller/method ' , (string ) $ request ->getUri ());
908
- $ this ->assertSame ('/ ci/v4/index.php/controller/method ' , $ request ->getUri ()->getPath ());
908
+ $ this ->assertSame ('ci/v4/index.php/controller/method ' , $ request ->getUri ()->getPath ());
909
909
910
910
// standalone
911
911
$ uri = new URI ('http://example.com/ci/v4/index.php/controller/method ' );
912
912
$ this ->assertSame ('http://example.com/ci/v4/index.php/controller/method ' , (string ) $ uri );
913
913
$ this ->assertSame ('/ci/v4/index.php/controller/method ' , $ uri ->getPath ());
914
914
915
- $ this ->assertSame ($ uri ->getPath (), $ request ->getUri ()->getPath ());
915
+ $ this ->assertSame ($ uri ->getPath (), ' / ' . $ request ->getUri ()->getPath ());
916
916
}
917
917
918
918
public function testForceGlobalSecureRequests ()
0 commit comments