diff --git a/spec/Phpro/SoapClient/CodeGenerator/Model/TypeSpec.php b/spec/Phpro/SoapClient/CodeGenerator/Model/TypeSpec.php index 63426c50..287fcabd 100644 --- a/spec/Phpro/SoapClient/CodeGenerator/Model/TypeSpec.php +++ b/spec/Phpro/SoapClient/CodeGenerator/Model/TypeSpec.php @@ -53,7 +53,7 @@ function it_has_a_path_name() function it_should_replace_underscores_in_paths() { $this->beConstructedWith('MyNamespace', 'myType_3_2', ['prop1' => 'string']); - $this->getFileInfo('my/dir')->getPathname()->shouldReturn('my/dir/MyType/3/2.php'); + $this->getFileInfo('my/some_dir')->getPathname()->shouldReturn('my/some_dir/MyType/3/2.php'); } function it_has_properties() diff --git a/src/Phpro/SoapClient/CodeGenerator/Model/Type.php b/src/Phpro/SoapClient/CodeGenerator/Model/Type.php index 475d85ba..3885f8a7 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Model/Type.php +++ b/src/Phpro/SoapClient/CodeGenerator/Model/Type.php @@ -78,8 +78,8 @@ public function getXsdName() public function getFileInfo(string $destination) : SplFileInfo { - $path = rtrim($destination, '/\\').DIRECTORY_SEPARATOR.$this->getName().'.php'; - $path = str_replace('_', DIRECTORY_SEPARATOR, $path); + $name = str_replace('_', DIRECTORY_SEPARATOR, $this->getName()); + $path = rtrim($destination, '/\\').DIRECTORY_SEPARATOR.$name.'.php'; return new SplFileInfo($path); }