@@ -863,56 +863,56 @@ public function testSetBadSegmentSilent()
863863
864864 public function testBasedNoIndex ()
865865 {
866- $ this ->resetServices ();
867-
868866 $ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
869867 $ _SERVER ['REQUEST_URI ' ] = '/ci/v4/controller/method ' ;
870868
869+ $ this ->resetServices ();
870+
871871 $ 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 );
876875
876+ $ request = Services::request ($ config );
877877 Services::injectMock ('request ' , $ request );
878878
879879 // going through request
880880 $ 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 ());
882882
883883 // standalone
884884 $ uri = new URI ('http://example.com/ci/v4/controller/method ' );
885885 $ this ->assertSame ('http://example.com/ci/v4/controller/method ' , (string ) $ uri );
886886 $ this ->assertSame ('/ci/v4/controller/method ' , $ uri ->getPath ());
887887
888- $ this ->assertSame ($ uri ->getPath (), $ request ->getUri ()->getPath ());
888+ $ this ->assertSame ($ uri ->getPath (), ' / ' . $ request ->getUri ()->getPath ());
889889 }
890890
891891 public function testBasedWithIndex ()
892892 {
893- $ this ->resetServices ();
894-
895893 $ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
896894 $ _SERVER ['REQUEST_URI ' ] = '/ci/v4/index.php/controller/method ' ;
897895
896+ $ this ->resetServices ();
897+
898898 $ config = new App ();
899- $ config ->baseURL = 'http://example.com/ci/v4 ' ;
899+ $ config ->baseURL = 'http://example.com/ci/v4/ ' ;
900900 $ 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 );
903902
903+ $ request = Services::request ($ config );
904904 Services::injectMock ('request ' , $ request );
905905
906906 // going through request
907907 $ 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 ());
909909
910910 // standalone
911911 $ uri = new URI ('http://example.com/ci/v4/index.php/controller/method ' );
912912 $ this ->assertSame ('http://example.com/ci/v4/index.php/controller/method ' , (string ) $ uri );
913913 $ this ->assertSame ('/ci/v4/index.php/controller/method ' , $ uri ->getPath ());
914914
915- $ this ->assertSame ($ uri ->getPath (), $ request ->getUri ()->getPath ());
915+ $ this ->assertSame ($ uri ->getPath (), ' / ' . $ request ->getUri ()->getPath ());
916916 }
917917
918918 public function testForceGlobalSecureRequests ()
0 commit comments