File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -144,12 +144,13 @@ class OneLogin_Saml2_Auth
144144     * Initializes the SP SAML instance. 
145145     * 
146146     * @param array|object|null $oldSettings Setting data (You can provide a OneLogin_Saml_Settings, the settings object of the Saml folder implementation) 
147+      * @param bool $spValidationOnly if you only as an SP , you should set it to false if not you should set it to true 
147148     * 
148149     * @throws OneLogin_Saml2_Error 
149150     */ 
150-     public  function  __construct ($ oldSettings  = null )
151+     public  function  __construct ($ oldSettings  = null  ,  $ spValidationOnly  =  true )
151152    {
152-         $ this  ->_settings  = new  OneLogin_Saml2_Settings ($ oldSettings );
153+         $ this  ->_settings  = new  OneLogin_Saml2_Settings ($ oldSettings,  $ spValidationOnly  );
153154    }
154155
155156    /** 
Original file line number Diff line number Diff line change @@ -1164,4 +1164,17 @@ public function testIsDebugActive()
11641164        $ settings3  = new  OneLogin_Saml2_Settings ($ settingsInfo );
11651165        $ this  ->assertTrue ($ settings3 ->isDebugActive ());
11661166    }
1167+     /** 
1168+      * Tests the checkSettings method of the OneLogin_Saml2_Settings 
1169+      * 
1170+      * @covers OneLogin_Saml2_Settings::checkSettings 
1171+      */ 
1172+     public  function  testSpValidateOnlyIsTrue ()
1173+     {
1174+         $ settingsDir  = TEST_ROOT  .'/settings/ ' ;
1175+         include  $ settingsDir .'settings2.php ' ;
1176+         unset($ settingsInfo ['idp ' ]);
1177+         $ settings  = new  OneLogin_Saml2_Settings ($ settingsInfo ,true );
1178+         $ this  ->assertEmpty ($ settings ->getErrors ());
1179+     }
11671180}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments