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
2222 */
2323 private $ model ;
2424
25+ /**
26+ * @var DuoSecurity
27+ */
28+ private $ modelWithForcedDuoAuth ;
29+
2530 /**
2631 * @var ScopeConfigInterface|MockObject
2732 */
@@ -42,6 +47,7 @@ protected function setUp(): void
4247 $ this ->user = $ this ->getMockBuilder (UserInterface::class)->disableOriginalConstructor ()->getMock ();
4348
4449 $ this ->model = $ objectManager ->getObject (DuoSecurity::class, ['scopeConfig ' => $ this ->configMock ]);
50+ $ this ->modelWithForcedDuoAuth = new DuoSecurity ($ this ->configMock , true );
4551 }
4652
4753 /**
@@ -137,5 +143,15 @@ public function testGetRequestSignature() : void
137143 ->willReturn ('SECRET ' );
138144
139145 $ 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+ );
140156 }
141157}
You can’t perform that action at this time.
0 commit comments