@@ -376,6 +376,28 @@ public function testAssertSeeEscapedCanFail()
376
376
$ response ->assertSee (['bar & baz ' , 'baz & qux ' ]);
377
377
}
378
378
379
+ public function testAssertSeeHtml ()
380
+ {
381
+ $ response = $ this ->makeMockResponse ([
382
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
383
+ ]);
384
+
385
+ $ response ->assertSeeHtml ('<li>foo</li> ' );
386
+ $ response ->assertSeeHtml (['<li>baz</li> ' , '<li>bar</li> ' ]);
387
+ }
388
+
389
+ public function testAssertSeeHtmlCanFail ()
390
+ {
391
+ $ this ->expectException (AssertionFailedError::class);
392
+
393
+ $ response = $ this ->makeMockResponse ([
394
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
395
+ ]);
396
+
397
+ $ response ->assertSeeHtml ('<li>item</li> ' );
398
+ $ response ->assertSeeHtml (['<li>not</li> ' , '<li>found</li> ' ]);
399
+ }
400
+
379
401
public function testAssertSeeInOrder ()
380
402
{
381
403
$ response = $ this ->makeMockResponse ([
@@ -409,6 +431,39 @@ public function testAssertSeeInOrderCanFail2()
409
431
$ response ->assertSeeInOrder (['foo ' , 'qux ' , 'bar ' , 'baz ' ]);
410
432
}
411
433
434
+ public function testAssertSeeHtmlInOrder ()
435
+ {
436
+ $ response = $ this ->makeMockResponse ([
437
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
438
+ ]);
439
+
440
+ $ response ->assertSeeHtmlInOrder (['<li>foo</li> ' , '<li>bar</li> ' , '<li>baz</li> ' ]);
441
+
442
+ $ response ->assertSeeHtmlInOrder (['<li>foo</li> ' , '<li>bar</li> ' , '<li>baz</li> ' , '<li>foo</li> ' ]);
443
+ }
444
+
445
+ public function testAssertSeeHtmlInOrderCanFail ()
446
+ {
447
+ $ this ->expectException (AssertionFailedError::class);
448
+
449
+ $ response = $ this ->makeMockResponse ([
450
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
451
+ ]);
452
+
453
+ $ response ->assertSeeHtmlInOrder (['<li>baz</li> ' , '<li>bar</li> ' , '<li>foo</li> ' ]);
454
+ }
455
+
456
+ public function testAssertSeeHtmlInOrderCanFail2 ()
457
+ {
458
+ $ this ->expectException (AssertionFailedError::class);
459
+
460
+ $ response = $ this ->makeMockResponse ([
461
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
462
+ ]);
463
+
464
+ $ response ->assertSeeHtmlInOrder (['<li>foo</li> ' , '<li>qux</li> ' , '<li>bar</li> ' , '<li>baz</li> ' ]);
465
+ }
466
+
412
467
public function testAssertSeeText ()
413
468
{
414
469
$ response = $ this ->makeMockResponse ([
@@ -539,6 +594,28 @@ public function testAssertDontSeeEscapedCanFail()
539
594
$ response ->assertDontSee (['php & friends ' , 'laravel & php ' ]);
540
595
}
541
596
597
+ public function testAssertDontSeeHtml ()
598
+ {
599
+ $ response = $ this ->makeMockResponse ([
600
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
601
+ ]);
602
+
603
+ $ response ->assertDontSeeHtml ('<li>laravel</li> ' );
604
+ $ response ->assertDontSeeHtml (['<li>php</li> ' , '<li>friends</li> ' ]);
605
+ }
606
+
607
+ public function testAssertDontSeeHtmlCanFail ()
608
+ {
609
+ $ this ->expectException (AssertionFailedError::class);
610
+
611
+ $ response = $ this ->makeMockResponse ([
612
+ 'render ' => '<ul><li>foo</li><li>bar</li><li>baz</li><li>foo</li></ul> ' ,
613
+ ]);
614
+
615
+ $ response ->assertDontSeeHtml ('<li>foo</li> ' );
616
+ $ response ->assertDontSeeHtml (['<li>baz</li> ' , '<li>bar</li> ' ]);
617
+ }
618
+
542
619
public function testAssertDontSeeText ()
543
620
{
544
621
$ response = $ this ->makeMockResponse ([
0 commit comments