Use JsonFile::JSON_PRETTY_PRINT instead of php const for PHP 5.3 compat
parent
28596d9c12
commit
bd6b4e433c
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue