Fix failing tests on Windows

escapeshellargs() uses different quotation mark characters between Linux
and Windows, so tests were failing on Windows. This change uses a
regular expression instead.
This commit is contained in:
Ben Ramsey
2020-03-17 11:43:45 -05:00
parent 744c05798a
commit fcfcd3fb60
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Test\Provider\Dce;
use Mockery;
use Ramsey\Uuid\Exception\DceSecurityException;
use Ramsey\Uuid\Provider\Dce\SystemDceSecurityProvider;
use Ramsey\Uuid\Test\TestCase;
@@ -365,7 +366,7 @@ class SystemDceSecurityProviderTest extends TestCase
->andReturn('Local Group Memberships *Users');
$shellExec
->with("wmic group get name,sid | findstr /b /i 'Users'")
->with(Mockery::pattern("/^wmic group get name,sid \| findstr \/b \/i (\"|\')Users(\"|\')$/"))
->once()
->andReturn($value);
@@ -410,7 +411,7 @@ class SystemDceSecurityProviderTest extends TestCase
->andReturn($netUserResponse);
$shellExec
->with("wmic group get name,sid | findstr /b /i '{$expectedGroup}'")
->with(Mockery::pattern("/^wmic group get name,sid \| findstr \/b \/i (\"|\'){$expectedGroup}(\"|\')$/"))
->once()
->andReturn($wmicGroupResponse);