Commit c43d61b 1 parent 4bf537c commit c43d61b Copy full SHA for c43d61b
File tree 2 files changed +58
-0
lines changed
2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,35 @@ public function testGetSettings()
52
52
$ this ->assertEquals ($ authSettings , $ settings );
53
53
}
54
54
55
+ /**
56
+ * Tests the use of the spValidationOnly at OneLogin\Saml2\Auth
57
+ *
58
+ * @covers OneLogin\Saml2\Auth
59
+ */
60
+ public function testSpValidateOnly ()
61
+ {
62
+ $ settingsDir = TEST_ROOT .'/settings/ ' ;
63
+ include $ settingsDir .'settings2.php ' ;
64
+ unset($ settingsInfo ['idp ' ]);
65
+
66
+ $ auth = new Auth ($ settingsInfo , true );
67
+ $ this ->assertEmpty ($ auth ->getErrors ());
68
+
69
+ try {
70
+ $ auth2 = new Auth ($ settingsInfo , false );
71
+ $ this ->fail ('Error was not raised ' );
72
+ } catch (Error $ e ) {
73
+ $ this ->assertStringContainsString ('idp_not_found ' , $ e ->getMessage ());
74
+ }
75
+
76
+ try {
77
+ $ auth3 = new Auth ($ settingsInfo );
78
+ $ this ->fail ('Error was not raised ' );
79
+ } catch (Error $ e ) {
80
+ $ this ->assertStringContainsString ('idp_not_found ' , $ e ->getMessage ());
81
+ }
82
+ }
83
+
55
84
/**
56
85
* Tests the getLastRequestID method of the Auth class
57
86
*
Original file line number Diff line number Diff line change @@ -64,6 +64,35 @@ public function testLoadSettingsFromFile()
64
64
$ this ->assertEmpty ($ settings ->getErrors ());
65
65
}
66
66
67
+ /**
68
+ * Tests the use of the spValidationOnly at OneLogin\Saml2\Settings
69
+ *
70
+ * @covers OneLogin\Saml2\Settings
71
+ */
72
+ public function testSpValidateOnly ()
73
+ {
74
+ $ settingsDir = TEST_ROOT .'/settings/ ' ;
75
+ include $ settingsDir .'settings2.php ' ;
76
+ unset($ settingsInfo ['idp ' ]);
77
+
78
+ $ settings = new Settings ($ settingsInfo , true );
79
+ $ this ->assertEmpty ($ settings ->getErrors ());
80
+
81
+ try {
82
+ $ settings2 = new Settings ($ settingsInfo , false );
83
+ $ this ->fail ('Error was not raised ' );
84
+ } catch (Error $ e ) {
85
+ $ this ->assertStringContainsString ('idp_not_found ' , $ e ->getMessage ());
86
+ }
87
+
88
+ try {
89
+ $ settings3 = new Settings ($ settingsInfo );
90
+ $ this ->fail ('Error was not raised ' );
91
+ } catch (Error $ e ) {
92
+ $ this ->assertStringContainsString ('idp_not_found ' , $ e ->getMessage ());
93
+ }
94
+ }
95
+
67
96
/**
68
97
* Tests getCertPath method of the Settings
69
98
*
You can’t perform that action at this time.
0 commit comments