File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
TwoFactorAuth/Test/Unit/Model/Provider/Engine Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ class DuoSecurityTest extends TestCase
22
22
*/
23
23
private $ model ;
24
24
25
+ /**
26
+ * @var DuoSecurity
27
+ */
28
+ private $ modelWithForcedDuoAuth ;
29
+
25
30
/**
26
31
* @var ScopeConfigInterface|MockObject
27
32
*/
@@ -42,6 +47,7 @@ protected function setUp(): void
42
47
$ this ->user = $ this ->getMockBuilder (UserInterface::class)->disableOriginalConstructor ()->getMock ();
43
48
44
49
$ this ->model = $ objectManager ->getObject (DuoSecurity::class, ['scopeConfig ' => $ this ->configMock ]);
50
+ $ this ->modelWithForcedDuoAuth = new DuoSecurity ($ this ->configMock , true );
45
51
}
46
52
47
53
/**
@@ -137,5 +143,15 @@ public function testGetRequestSignature() : void
137
143
->willReturn ('SECRET ' );
138
144
139
145
$ this ->assertStringContainsString ($ this ->model ::AUTH_PREFIX , $ this ->model ->getRequestSignature ($ this ->user ));
146
+ $ this ->assertStringNotContainsString ($ this ->model ::DUO_PREFIX , $ this ->model ->getRequestSignature ($ this ->user ));
147
+
148
+ $ this ->assertStringContainsString (
149
+ $ this ->model ::DUO_PREFIX ,
150
+ $ this ->modelWithForcedDuoAuth ->getRequestSignature ($ this ->user )
151
+ );
152
+ $ this ->assertStringNotContainsString (
153
+ $ this ->model ::AUTH_PREFIX ,
154
+ $ this ->modelWithForcedDuoAuth ->getRequestSignature ($ this ->user )
155
+ );
140
156
}
141
157
}
You can’t perform that action at this time.
0 commit comments