5
5
use Codeception \Module ;
6
6
use GuzzleHttp \Client ;
7
7
use GuzzleHttp \Psr7 \Stream ;
8
- use PHPUnit_Framework_Constraint_IsEqual ;
9
- use PHPUnit_Framework_Constraint_StringContains ;
8
+ use PHPUnit \Framework \Assert ;
10
9
11
10
/**
12
11
* This module allows you to test emails using Mailtrap <https://mailtrap.io>.
@@ -380,7 +379,7 @@ public function waitForEmailWithSubject($subject, $timeout = 5)
380
379
$ condition = function () use ($ subject ) {
381
380
$ emails = $ this ->fetchMessages ();
382
381
foreach ($ emails as $ email ) {
383
- $ constraint = new PHPUnit_Framework_Constraint_IsEqual ($ subject );
382
+ $ constraint = Assert:: equalTo ($ subject );
384
383
if ($ constraint ->evaluate ($ email ['subject ' ], '' , true )) {
385
384
return true ;
386
385
}
@@ -407,7 +406,7 @@ public function waitForEmailWithTextInTextBody($text, $timeout = 5)
407
406
$ condition = function () use ($ text ) {
408
407
$ emails = $ this ->fetchMessages ();
409
408
foreach ($ emails as $ email ) {
410
- $ constraint = new PHPUnit_Framework_Constraint_StringContains ($ text );
409
+ $ constraint = Assert:: stringContains ($ text );
411
410
if ($ constraint ->evaluate ($ email ['text_body ' ], '' , true )) {
412
411
return true ;
413
412
}
@@ -434,7 +433,7 @@ public function waitForEmailWithTextInHTMLBody($text, $timeout = 5)
434
433
$ condition = function () use ($ text ) {
435
434
$ emails = $ this ->fetchMessages ();
436
435
foreach ($ emails as $ email ) {
437
- $ constraint = new PHPUnit_Framework_Constraint_StringContains ($ text );
436
+ $ constraint = Assert:: stringContains ($ text );
438
437
if ($ constraint ->evaluate ($ email ['html_body ' ], '' , true )) {
439
438
return true ;
440
439
}
0 commit comments