make some time dependent tests more resilient

This commit is contained in:
Christian Flothmann 2021-01-05 09:52:12 +01:00
parent e1b81d513e
commit a33850e838
2 changed files with 5 additions and 2 deletions

View File

@ -110,7 +110,7 @@ class DirectoryResourceTest extends TestCase
{
$resource = new DirectoryResource($this->directory);
$time = time();
sleep(1);
usleep(1500000);
unlink($this->directory.'/tmp.xml');
$this->assertFalse($resource->isFresh($time), '->isFresh() returns false if an existing file is removed');
}

View File

@ -22,6 +22,9 @@ use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Exception\InvalidArgumentException;
use Symfony\Component\Mime\RawMessage;
/**
* @group time-sensitive
*/
class SmtpTransportTest extends TestCase
{
public function testToString()
@ -83,7 +86,7 @@ class SmtpTransportTest extends TestCase
$this->assertNotContains("NOOP\r\n", $stream->getCommands());
$stream->clearCommands();
sleep(1);
usleep(1500000);
$transport->send(new RawMessage('Message 3'), $envelope);
$this->assertContains("NOOP\r\n", $stream->getCommands());