File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,14 @@ public function assertContainsElement(): Closure
9696            );
9797
9898            try  {
99-                 $ parser  = DomParser::new ((string ) $ this  );
99+                 if  (! app ()->has ('dom-assertions.parser ' )) {
100+                     app ()->instance ('dom-assertions.parser ' , DomParser::new ((string ) $ this  ));
101+                 }
100102            } catch  (DOMException   $ exception ) {
101103                Assert::fail ($ exception ->getMessage ());
102104            }
103105
104-             $ element  = $ parser ->query ($ selector );
106+             $ element  = app ()-> make ( ' dom-assertions. parser' ) ->query ($ selector );
105107
106108            Assert::assertNotNull (
107109                $ element ,
Original file line number Diff line number Diff line change @@ -96,12 +96,14 @@ public function assertContainsElement(): Closure
9696            );
9797
9898            try  {
99-                 $ parser  = DomParser::new ($ this  ->getContent ());
99+                 if  (! app ()->has ('dom-assertions.parser ' )) {
100+                     app ()->instance ('dom-assertions.parser ' , DomParser::new ($ this  ->getContent ()));
101+                 }
100102            } catch  (DOMException   $ exception ) {
101103                Assert::fail ($ exception ->getMessage ());
102104            }
103105
104-             $ element  = $ parser ->query ($ selector );
106+             $ element  = app ()-> make ( ' dom-assertions. parser' ) ->query ($ selector );
105107
106108            Assert::assertNotNull (
107109                $ element ,
Original file line number Diff line number Diff line change @@ -96,12 +96,14 @@ public function assertContainsElement(): Closure
9696            );
9797
9898            try  {
99-                 $ parser  = DomParser::new ((string ) $ this  );
99+                 if  (! app ()->has ('dom-assertions.parser ' )) {
100+                     app ()->instance ('dom-assertions.parser ' , DomParser::new ((string ) $ this  ));
101+                 }
100102            } catch  (DOMException   $ exception ) {
101103                Assert::fail ($ exception ->getMessage ());
102104            }
103105
104-             $ element  = $ parser ->query ($ selector );
106+             $ element  = app ()-> make ( ' dom-assertions. parser' ) ->query ($ selector );
105107
106108            Assert::assertNotNull (
107109                $ element ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments