Skip to content

Commit

Permalink
Fix fatal syntax error "unexpected '-', expecting '{'" caused by spec…
Browse files Browse the repository at this point in the history
…ial chars

This belongs to sebastianbergmann/phpunit-mock-objects#424
  • Loading branch information
Hecke29 authored and sebastianbergmann committed Aug 7, 2018
1 parent bc49df6 commit d64306d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,8 @@ protected function getMockForAbstractClass($originalClassName, array $arguments
protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = [], $callOriginalConstructor = true, array $options = [])
{
if ($originalClassName === '') {
$originalClassName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), PATHINFO_FILENAME);
$fileName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), PATHINFO_FILENAME);
$originalClassName = preg_replace('/[^a-zA-Z0-9_]/', '', $fileName);
}

if (!\class_exists($originalClassName)) {
Expand Down

0 comments on commit d64306d

Please sign in to comment.