Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #25 from sergiusd/max_nesting_level
Browse files Browse the repository at this point in the history
Set a higher level of nesting
  • Loading branch information
freekmurze authored Sep 25, 2017
2 parents cad3fcb + 99a8f36 commit 4ede5c5
Show file tree
Hide file tree
Showing 3 changed files with 2,920 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function saveAsPhp5($destination)
*/
public function getPhp5Code()
{
ini_set('xdebug.max_nesting_level', 3000);
ini_set('xdebug.max_nesting_level', 9000);

$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);

Expand Down
16 changes: 16 additions & 0 deletions tests/ConsoleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ public function it_can_convert_all_files_from_a_given_directory_if_option_copy_a
]);
}

/** @test */
public function it_can_convert_file_with_large_nesting()
{
$fs = new Filesystem();
$file = 'maxNestingLevel.php';
$destinationFile = $this->destinationDirectory.'/'.$file;
$sourceFile = $this->getConsoleCommand().'/'.$file;
$fs->makeDirectory(dirname($destinationFile));
$command = $this->getCommand($sourceFile, $destinationFile, '--overwrite');
$this->runCommand($command);

$this->assertTempFileExists([
$destinationFile,
]);
}

/** @test */
public function it_throws_an_exception_if_a_file_exist_and_overwriting_is_not_allowed()
{
Expand Down
Loading

0 comments on commit 4ede5c5

Please sign in to comment.