1
0
Fork 0

Use JsonFile::JSON_PRETTY_PRINT instead of php const for PHP 5.3 compat

pull/7936/head
Nils Adermann 2019-11-07 22:09:24 +01:00
parent 28596d9c12
commit bd6b4e433c
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ class InstallerTest extends TestCase
$lockJsonMock->expects($this->any()) $lockJsonMock->expects($this->any())
->method('write') ->method('write')
->will($this->returnCallback(function ($value, $options = 0) use (&$lockData) { ->will($this->returnCallback(function ($value, $options = 0) use (&$lockData) {
$lockData = json_encode($value, JSON_PRETTY_PRINT); $lockData = json_encode($value, JsonFile::JSON_PRETTY_PRINT);
})); }));
$tempLockData = null; $tempLockData = null;
@ -216,7 +216,7 @@ class InstallerTest extends TestCase
$repositoryManager->setLocalRepository(new InstalledFilesystemRepositoryMock($jsonMock)); $repositoryManager->setLocalRepository(new InstalledFilesystemRepositoryMock($jsonMock));
// emulate a writable lock file // emulate a writable lock file
$lockData = $lock ? json_encode($lock, JSON_PRETTY_PRINT): null; $lockData = $lock ? json_encode($lock, JsonFile::JSON_PRETTY_PRINT): null;
$lockJsonMock = $this->getMockBuilder('Composer\Json\JsonFile')->disableOriginalConstructor()->getMock(); $lockJsonMock = $this->getMockBuilder('Composer\Json\JsonFile')->disableOriginalConstructor()->getMock();
$lockJsonMock->expects($this->any()) $lockJsonMock->expects($this->any())
->method('read') ->method('read')
@ -231,7 +231,7 @@ class InstallerTest extends TestCase
$lockJsonMock->expects($this->any()) $lockJsonMock->expects($this->any())
->method('write') ->method('write')
->will($this->returnCallback(function ($value, $options = 0) use (&$lockData) { ->will($this->returnCallback(function ($value, $options = 0) use (&$lockData) {
$lockData = json_encode($value, JSON_PRETTY_PRINT); $lockData = json_encode($value, JsonFile::JSON_PRETTY_PRINT);
})); }));
if ($expectLock) { if ($expectLock) {