@@ -1165,7 +1165,7 @@ public function testIsDebugActive()
11651165 $ this ->assertTrue ($ settings3 ->isDebugActive ());
11661166 }
11671167 /**
1168- * Tests the checkSettings method of the OneLogin_Saml2_Settings
1168+ * Tests the checkSettings method of the OneLogin_Saml2_Settings when SpValidateOnly is false and IdP is not defined
11691169 *
11701170 * @covers OneLogin_Saml2_Settings::checkSettings
11711171 */
@@ -1174,7 +1174,25 @@ public function testSpValidateOnlyIsTrue()
11741174 $ settingsDir = TEST_ROOT .'/settings/ ' ;
11751175 include $ settingsDir .'settings2.php ' ;
11761176 unset($ settingsInfo ['idp ' ]);
1177- $ settings = new OneLogin_Saml2_Settings ($ settingsInfo ,true );
1177+ $ settings = new OneLogin_Saml2_Settings ($ settingsInfo , true );
11781178 $ this ->assertEmpty ($ settings ->getErrors ());
11791179 }
1180+
1181+ /**
1182+ * Tests the checkSettings method of the OneLogin_Saml2_Settings when SpValidateOnly is false and IdP is not defined
1183+ *
1184+ * @covers OneLogin_Saml2_Settings::checkSettings
1185+ */
1186+ public function testSpValidateOnlyIsFalse ()
1187+ {
1188+ $ settingsDir = TEST_ROOT .'/settings/ ' ;
1189+ include $ settingsDir .'settings2.php ' ;
1190+ unset($ settingsInfo ['idp ' ]);
1191+ try {
1192+ $ settings = new OneLogin_Saml2_Settings ($ settingsInfo );
1193+ }catch (OneLogin_Saml2_Error $ e ) {
1194+ $ this ->assertContains ('idp_not_found ' , $ e ->getMessage ());
1195+ }
1196+ $ this ->assertEmpty ($ settings );
1197+ }
11801198}
0 commit comments