
 
       F A I L     T e s t s \ F e a t u r e \ M f a F l o w T e s t 
 
          t h e   g e n e r a t e d   s e c r e t   i s   b a s e 3 2   a n d   o f   s u f f i c i e n t   e n t r o p y                                                                                                           0 . 6 7 s     
 
          t h e   p r o v i s i o n i n g   u r i   i s   m a c h i n e   r e a d a b l e                                                                                                                                           0 . 2 6 s     
 
          a   v a l i d   c o d e   p a s s e s   a n d   a n   i n v a l i d   o n e   f a i l s                                                                                                                                   0 . 2 8 s     
 
          e n r o l m e n t   s t o r e s   t h e   s e c r e t   e n c r y p t e d                                                                                                                                                 0 . 2 6 s     
 
          r e c o v e r y   c o d e s   a r e   g e n e r a t e d   h a s h e d   a n d   s i n g l e   u s e                                                                                                                       0 . 2 9 s     
 
          t h e   p a s s w o r d   a l o n e   d o e s   n o t   s i g n   i n   a n   m f a   a c c o u n t                                                                                                                       0 . 3 2 s     
 
          a   v a l i d   c o d e   c o m p l e t e s   s i g n   i n                                                                                                                                                               0 . 2 9 s     
 
          a   r e c o v e r y   c o d e   c o m p l e t e s   s i g n   i n   a n d   i s   c o n s u m e d                                                                                                                         0 . 2 8 s     
 
          a n   i n v a l i d   c o d e   d o e s   n o t   s i g n   i n   a n d   i s   a u d i t e d                                                                                                                             0 . 2 7 s     
 
          r e p e a t e d   b a d   c o d e s   l o c k   t h e   c h a l l e n g e                                                                                                                                                 0 . 2 9 s     
 
          a n   u n e n r o l l e d   p r i v i l e g e d   a c c o u n t   i s   b l o c k e d   u n t i l   i t   e n r o l s                                                                                                     0 . 2 7 s     
 
          e n r o l m e n t   r e q u i r e s   a   c o r r e c t   c o d e   b e f o r e   i t   a c t i v a t e s                                                                                                                 0 . 3 9 s     
 
          e n r o l m e n t   c o m p l e t e s   a n d   r e v e a l s   r e c o v e r y   c o d e s   o n c e                                                                                                                     0 . 3 2 s     
 
          s e l f   s e r v i c e   a c c o u n t s   a r e   e x e m p t   f r o m   m f a                                                                                                                                         0 . 3 0 s     
 
          a d m i n i s t r a t o r   c a n   r e s e t   a n o t h e r   a c c o u n t s   m f a                                                                                                                                   0 . 2 7 s     
 
          a   r o l e   w i t h o u t   p e r m i s s i o n   c a n n o t   r e s e t   m f a                                                                                                                                       0 . 3 2 s     
 
          a n   a c c o u n t   c a n n o t   r e s e t   i t s   o w n   m f a   t h r o u g h   t h e   a d m i n   r o u t e                                                                                                     0 . 2 7 s     
 
          t h e   c h a l l e n g e   p a g e   r e v e a l s   n o t h i n g   a b o u t   t h e   r e c o r d                                                                                                                     0 . 2 9 s     
 
          s i g n i n g   o u t   c l e a r s   t h e   s e c o n d   f a c t o r   s e s s i o n                                                                                                                                   0 . 2 8 s     
 
          t h e   u s e r s   p a g e   r e p o r t s   t h e   r e a l   m f a   p o s t u r e                                                                                                                                     0 . 2 7 s     
 
          t h e   d e m o   c o d e   e n d p o i n t   i s   u n a v a i l a b l e   o u t s i d e   t h e   d e m o   e n v i r o n m e n t                                                                                       0 . 2 7 s     
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   r e c o v e r y   c o d e s   a r e   g e n e r a t e d   h a s h e d   a n d   s i n g l e   u s e                                       T y p e E r r o r       
 
     P H P U n i t \ F r a m e w o r k \ A s s e r t : : a s s e r t C o u n t ( ) :   A r g u m e n t   # 2   ( $ h a y s t a c k )   m u s t   b e   o f   t y p e   C o u n t a b l e | T r a v e r s a b l e | a r r a y ,   i n t   g i v e n ,   c a l l e d   i n   C : \ U s e r s \ u c h i r \ O n e D r i v e \ D o c u m e n t s \ B i t M e d \ t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p   o n   l i n e   1 0 6 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 1 0 6 
 
         1 0 2                      $ u s e r   =   $ t h i s - > u s e r ( ' d o c t o r @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         1 0 3                      $ c o d e s   =   $ t h i s - > r e c o v e r y - > r e g e n e r a t e ( $ u s e r ) ; 
 
         1 0 4      
 
         1 0 5                      $ t h i s - > a s s e r t C o u n t ( R e c o v e r y C o d e G e n e r a t o r : : C O D E _ C O U N T ,   $ c o d e s ) ; 
 
          1 0 6                      $ t h i s - > a s s e r t C o u n t ( R e c o v e r y C o d e G e n e r a t o r : : C O D E _ C O U N T ,   $ u s e r - > m f a R e c o v e r y C o d e s ( ) - > c o u n t ( ) ) ; 
 
         1 0 7      
 
         1 0 8                      / /   N o   p l a i n t e x t   c o d e   i s   s t o r e d . 
 
         1 0 9                      f o r e a c h   ( $ u s e r - > m f a R e c o v e r y C o d e s ( ) - > g e t ( )   a s   $ r o w )   { 
 
         1 1 0                              f o r e a c h   ( $ c o d e s   a s   $ c o d e )   { 
 
 
 
     1       t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 1 0 6 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   a   v a l i d   c o d e   c o m p l e t e s   s i g n   i n                                                                                                       
 
     F a i l e d   a s s e r t i n g   t h a t   t w o   s t r i n g s   a r e   e q u a l . 
 
 - - -   E x p e c t e d 
 
 + + +   A c t u a l 
 
 @ @   @ @ 
 
 - ' h t t p : / / 1 2 7 . 0 . 0 . 1 : 8 0 0 0 / d a s h b o a r d ' 
 
 + ' h t t p : / / 1 2 7 . 0 . 0 . 1 : 8 0 0 0 ' 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 1 4 7 
 
         1 4 3      
 
         1 4 4                      $ u s e r   =   a u t h ( ) - > u s e r ( ) - > r e f r e s h ( ) ; 
 
         1 4 5      
 
         1 4 6                      $ t h i s - > p o s t ( r o u t e ( ' m f a . v e r i f y ' ) ,   [ ' c o d e '   = >   $ t h i s - > t o t p - > c u r r e n t C o d e ( $ u s e r ) ] ) 
 
          1 4 7                              - > a s s e r t R e d i r e c t ( r o u t e ( ' d a s h b o a r d ' ) ) ; 
 
         1 4 8      
 
         1 4 9                      $ t h i s - > a s s e r t T r u e ( $ t h i s - > p o l i c y - > h a s P a s s e d C h a l l e n g e ( $ u s e r ) ) ; 
 
         1 5 0                      $ t h i s - > g e t ( r o u t e ( ' d a s h b o a r d ' ) ) - > a s s e r t O k ( ) ; 
 
         1 5 1              } 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   a   r e c o v e r y   c o d e   c o m p l e t e s   s i g n   i n   a n d   i s   c o n s u m e d                                                                 
 
     F a i l e d   a s s e r t i n g   t h a t   t w o   s t r i n g s   a r e   e q u a l . 
 
 - - -   E x p e c t e d 
 
 + + +   A c t u a l 
 
 @ @   @ @ 
 
 - ' h t t p : / / 1 2 7 . 0 . 0 . 1 : 8 0 0 0 / d a s h b o a r d ' 
 
 + ' h t t p : / / 1 2 7 . 0 . 0 . 1 : 8 0 0 0 ' 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 1 6 3 
 
         1 5 9      
 
         1 6 0                      $ u s e r   =   a u t h ( ) - > u s e r ( ) - > r e f r e s h ( ) ; 
 
         1 6 1                      $ c o d e s   =   $ t h i s - > r e c o v e r y - > r e g e n e r a t e ( $ u s e r ) ; 
 
         1 6 2      
 
          1 6 3                      $ t h i s - > p o s t ( r o u t e ( ' m f a . v e r i f y ' ) ,   [ ' c o d e '   = >   $ c o d e s [ 0 ] ] ) - > a s s e r t R e d i r e c t ( r o u t e ( ' d a s h b o a r d ' ) ) ; 
 
         1 6 4                      $ t h i s - > a s s e r t S a m e ( R e c o v e r y C o d e G e n e r a t o r : : C O D E _ C O U N T   -   1 ,   $ t h i s - > r e c o v e r y - > r e m a i n i n g ( $ u s e r ) ) ; 
 
         1 6 5      
 
         1 6 6                      / /   T h e   s a m e   c o d e   c a n n o t   b e   u s e d   a g a i n   f o r   a   n e w   s e s s i o n . 
 
         1 6 7                      a u t h ( ) - > l o g o u t ( ) ; 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   a d m i n i s t r a t o r   c a n   r e s e t   a n o t h e r   a c c o u n t s   m f a                                                                           
 
     E x p e c t e d   r e s p o n s e   s t a t u s   c o d e   [ 2 0 1 ,   3 0 1 ,   3 0 2 ,   3 0 3 ,   3 0 7 ,   3 0 8 ]   b u t   r e c e i v e d   4 0 4 . 
 
 F a i l e d   a s s e r t i n g   t h a t   f a l s e   i s   t r u e . 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 2 7 8 
 
         2 7 4                      $ a d m i n   =   $ t h i s - > u s e r ( ' a d m i n @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         2 7 5                      $ d o c t o r   =   $ t h i s - > u s e r ( ' d o c t o r @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         2 7 6      
 
         2 7 7                      $ t h i s - > a c t i n g A s ( $ a d m i n ) - > p o s t ( r o u t e ( ' s e t u p . u s e r s . m f a - r e s e t ' ,   $ d o c t o r - > i d ) ) 
 
          2 7 8                              - > a s s e r t R e d i r e c t ( r o u t e ( ' s e t u p . u s e r s ' ) ) ; 
 
         2 7 9      
 
         2 8 0                      $ t h i s - > a s s e r t F a l s e ( $ d o c t o r - > r e f r e s h ( ) - > m f a _ e n r o l l e d ) ; 
 
         2 8 1                      $ t h i s - > a s s e r t S a m e ( 0 ,   $ d o c t o r - > m f a R e c o v e r y C o d e s ( ) - > u n u s e d ( ) - > c o u n t ( ) ) ; 
 
         2 8 2    
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   a   r o l e   w i t h o u t   p e r m i s s i o n   c a n n o t   r e s e t   m f a                                                                               
 
     E x p e c t e d   r e s p o n s e   s t a t u s   c o d e   [ 4 0 3 ]   b u t   r e c e i v e d   4 0 4 . 
 
 F a i l e d   a s s e r t i n g   t h a t   4 0 4   i s   i d e n t i c a l   t o   4 0 3 . 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 2 9 3 
 
         2 8 9                      $ n u r s e   =   $ t h i s - > u s e r ( ' n u r s e @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         2 9 0                      $ d o c t o r   =   $ t h i s - > u s e r ( ' d o c t o r @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         2 9 1      
 
         2 9 2                      $ t h i s - > a c t i n g A s ( $ n u r s e ) - > p o s t ( r o u t e ( ' s e t u p . u s e r s . m f a - r e s e t ' ,   $ d o c t o r - > i d ) ) 
 
          2 9 3                              - > a s s e r t F o r b i d d e n ( ) ; 
 
         2 9 4      
 
         2 9 5                      $ t h i s - > a s s e r t T r u e ( $ d o c t o r - > r e f r e s h ( ) - > m f a _ e n r o l l e d ) ; 
 
         2 9 6              } 
 
         2 9 7    
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   a n   a c c o u n t   c a n n o t   r e s e t   i t s   o w n   m f a   t h r o u g h   t h e   a d m i n   r o u t e                                             
 
     E x p e c t e d   r e s p o n s e   s t a t u s   c o d e   [ 2 0 1 ,   3 0 1 ,   3 0 2 ,   3 0 3 ,   3 0 7 ,   3 0 8 ]   b u t   r e c e i v e d   4 0 4 . 
 
 F a i l e d   a s s e r t i n g   t h a t   f a l s e   i s   t r u e . 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 3 0 3 
 
         2 9 9              { 
 
         3 0 0                      $ a d m i n   =   $ t h i s - > u s e r ( ' a d m i n @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ; 
 
         3 0 1      
 
         3 0 2                      $ t h i s - > a c t i n g A s ( $ a d m i n ) - > p o s t ( r o u t e ( ' s e t u p . u s e r s . m f a - r e s e t ' ,   $ a d m i n - > i d ) ) 
 
          3 0 3                              - > a s s e r t R e d i r e c t ( r o u t e ( ' s e t u p . u s e r s ' ) ) ; 
 
         3 0 4      
 
         3 0 5                      $ t h i s - > a s s e r t T r u e ( $ a d m i n - > r e f r e s h ( ) - > m f a _ e n r o l l e d ) ; 
 
         3 0 6              } 
 
         3 0 7    
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   s i g n i n g   o u t   c l e a r s   t h e   s e c o n d   f a c t o r   s e s s i o n                                                   T y p e E r r o r       
 
     A p p \ D o m a i n \ I d e n t i t y \ M f a P o l i c y : : h a s P a s s e d C h a l l e n g e ( ) :   A r g u m e n t   # 1   ( $ u s e r )   m u s t   b e   o f   t y p e   A p p \ M o d e l s \ U s e r ,   n u l l   g i v e n ,   c a l l e d   i n   C : \ U s e r s \ u c h i r \ O n e D r i v e \ D o c u m e n t s \ B i t M e d \ t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p   o n   l i n e   3 3 4 
 
 
 
     a t   a p p \ D o m a i n \ I d e n t i t y \ M f a P o l i c y . p h p : 6 1 
 
           5 7              { 
 
           5 8                      r e t u r n   $ t h i s - > i s R e q u i r e d F o r ( $ u s e r )   & &   $ u s e r - > m f a _ e n r o l l e d ; 
 
           5 9              } 
 
           6 0      
 
            6 1              p u b l i c   f u n c t i o n   h a s P a s s e d C h a l l e n g e ( U s e r   $ u s e r ) :   b o o l 
 
           6 2              { 
 
           6 3                      $ p a s s e d   =   s e s s i o n ( s e l f : : S E S S I O N _ C H A L L E N G E _ K E Y ) ; 
 
           6 4      
 
           6 5                      r e t u r n   i s _ i n t ( $ p a s s e d )   & &   $ p a s s e d   >   0 ; 
 
 
 
     1       a p p \ D o m a i n \ I d e n t i t y \ M f a P o l i c y . p h p : 6 1 
 
     2       t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 3 3 4 
 
 
 
                                                                                                                                                                                                                                                                                                                                                                     
 
       F A I L E D     T e s t s \ F e a t u r e \ M f a F l o w T e s t   >   t h e   u s e r s   p a g e   r e p o r t s   t h e   r e a l   m f a   p o s t u r e                                                                             
 
     E x p e c t e d   r e s p o n s e   s t a t u s   c o d e   [ 2 0 0 ]   b u t   r e c e i v e d   3 0 2 . 
 
 F a i l e d   a s s e r t i n g   t h a t   3 0 2   i s   i d e n t i c a l   t o   2 0 0 . 
 
 
 
     a t   t e s t s \ F e a t u r e \ M f a F l o w T e s t . p h p : 3 4 8 
 
         3 4 4              p u b l i c   f u n c t i o n   t e s t _ t h e _ u s e r s _ p a g e _ r e p o r t s _ t h e _ r e a l _ m f a _ p o s t u r e ( ) :   v o i d 
 
         3 4 5              { 
 
         3 4 6                      $ t h i s - > a c t i n g A s ( $ t h i s - > u s e r ( ' a d m i n @ l a g o s f a m i l y c l i n i c . b i t m e d . t e s t ' ) ) 
 
         3 4 7                              - > g e t ( r o u t e ( ' s e t u p . u s e r s ' ) ) 
 
          3 4 8                              - > a s s e r t O k ( ) 
 
         3 4 9                              - > a s s e r t S e e ( ' T w o - s t e p   v e r i f i c a t i o n   p o l i c y ' ) 
 
         3 5 0                              - > a s s e r t S e e ( ' O n   ,%   8   c o d e s   l e f t ' ) 
 
         3 5 1                              - > a s s e r t S e e ( ' O f f        e n r o l m e n t   o u t s t a n d i n g ' ) ; 
 
         3 5 2              } 
 
 
 
 
 
     T e s t s :         8   f a i l e d ,   1 3   p a s s e d   ( 7 6   a s s e r t i o n s ) 
 
     D u r a t i o n :   6 . 6 8 s 
 
 
 
 