diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php index e31201caf943440ce75a00725b65c79cde471c29..2b82c10311b050b091b56b9ff30d709e8ce060c5 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php @@ -95,7 +95,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase // This test is only valid if the factory created the object if Autoloader did not pick it up automatically if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) { $content = $this->_clearDocBlock( - file_get_contents($this->_ioObject->getResultFileName(self::CLASS_NAME_WITH_NAMESPACE . 'Factory')) + file_get_contents($this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . 'Factory')) ); $expectedContent = $this->_clearDocBlock( file_get_contents(__DIR__ . '/_expected/SourceClassWithNamespaceFactory.php.sample') @@ -120,7 +120,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase // This test is only valid if the factory created the object if Autoloader did not pick it up automatically if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) { $content = $this->_clearDocBlock( - file_get_contents($this->_ioObject->getResultFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Proxy')) + file_get_contents($this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Proxy')) ); $expectedContent = $this->_clearDocBlock( file_get_contents(__DIR__ . '/_expected/SourceClassWithNamespaceProxy.php.sample') @@ -142,7 +142,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase if (\Magento\Framework\Code\Generator::GENERATION_SUCCESS == $generatorResult) { $content = $this->_clearDocBlock( file_get_contents( - $this->_ioObject->getResultFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Interceptor') + $this->_ioObject->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Interceptor') ) ); $expectedContent = $this->_clearDocBlock( diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php index acbc463380d5292bab9de0851a1328ef4cebe3d3..8f53d379a51248ca7db352ef9234afa16153a835 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/EntityChildTestAbstract.php @@ -109,7 +109,7 @@ abstract class EntityChildTestAbstract extends \PHPUnit_Framework_TestCase //Mocking generation $this->ioObjectMock->expects($this->any()) - ->method('getResultFileName') + ->method('makeGeneratedClassFileName') ->with($this->getResultClassName()) ->willReturn($resultFileName); $this->ioObjectMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php index a78b00f1ceebd60559f0a786342f965d83703b47..fec3d96f8b539ad3088134a5a6139cf3e78de275 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateMapperTest.php @@ -51,7 +51,7 @@ class GenerateMapperTest extends \PHPUnit_Framework_TestCase ); $sampleMapperCode = file_get_contents(__DIR__ . '/_files/SampleMapper.txt'); $this->ioObjectMock->expects($this->once()) - ->method('getResultFileName') + ->method('makeGeneratedClassFileName') ->with('\Magento\Framework\Api\Code\Generator\SampleMapper') ->will($this->returnValue('SampleMapper.php')); $this->ioObjectMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php index 7ee5ff3acff604ad716f27d0886f6ac06c58fc33..5d54d23f55f318ba2db7dfcef2c967531d83359e 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php @@ -52,7 +52,7 @@ class GenerateSearchResultsTest extends \PHPUnit_Framework_TestCase ); $sampleSearchResultBuilderCode = file_get_contents(__DIR__ . '/_files/SampleSearchResults.txt'); $this->ioObjectMock->expects($this->once()) - ->method('getResultFileName') + ->method('makeGeneratedClassFileName') ->with('\Magento\Framework\Api\Code\Generator\SampleSearchResults') ->will($this->returnValue('SampleSearchResults.php')); $this->ioObjectMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/Code/Generator.php b/lib/internal/Magento/Framework/Code/Generator.php index 824f4f445aef9dc451e83d6e33935c6bbb95ef43..39c8ae07219c38ab893ef7d7c1785c00320e5919 100644 --- a/lib/internal/Magento/Framework/Code/Generator.php +++ b/lib/internal/Magento/Framework/Code/Generator.php @@ -191,7 +191,7 @@ class Generator if (!$resultEntityType || !$sourceClassName) { return self::GENERATION_ERROR; } else if ($this->definedClasses->isClassLoadableFromDisc($resultClass)) { - $generatedFileName = $this->_ioObject->getResultFileName($resultClass); + $generatedFileName = $this->_ioObject->makeGeneratedClassFileName($resultClass); /** * Must handle two edge cases: a competing process has generated the class and written it to disc already, * or the class exists in committed code, despite matching pattern to be generated. diff --git a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php index d99838bf4d06bb532411e3933bb9e3f32cfb67a0..d3ef4a0b54d3dc5c3ddc23d9fee0b19daeb6e4ec 100644 --- a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php +++ b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php @@ -97,7 +97,7 @@ abstract class EntityAbstract if ($this->_validateData()) { $sourceCode = $this->_generateCode(); if ($sourceCode) { - $fileName = $this->_ioObject->getResultFileName($this->_getResultClassName()); + $fileName = $this->_ioObject->makeGeneratedClassFileName($this->_getResultClassName()); $this->_ioObject->writeResultFile($fileName, $sourceCode); return $fileName; } else { diff --git a/lib/internal/Magento/Framework/Code/Generator/Io.php b/lib/internal/Magento/Framework/Code/Generator/Io.php index 04457e916b6c70ba62c4f1c73f2a0d394a221697..d50b7fc8ae24abdd7feb1b28580e9e059d908c9d 100644 --- a/lib/internal/Magento/Framework/Code/Generator/Io.php +++ b/lib/internal/Magento/Framework/Code/Generator/Io.php @@ -61,7 +61,7 @@ class Io */ public function getResultFileDirectory($className) { - $fileName = $this->getResultFileName($className); + $fileName = $this->makeGeneratedClassFileName($className); $pathParts = explode('/', $fileName); unset($pathParts[count($pathParts) - 1]); @@ -72,7 +72,7 @@ class Io * @param string $className * @return string */ - public function getResultFileName($className) + public function makeGeneratedClassFileName($className) { return $this->_generationDirectory . ltrim(str_replace(['\\', '_'], '/', $className), '/') . '.php'; } diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php index 67b43a173a1081c6173f219ea3e917846b8cbf60..677685ce01612a61141538475de14eac73f3abf8 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/EntityAbstractTest.php @@ -286,7 +286,7 @@ class EntityAbstractTest extends \PHPUnit_Framework_TestCase if ($willWriteCode) { $ioObject->expects($this->once())->method('writeResultFile')->with(self::RESULT_FILE, self::RESULT_CODE); } - $ioObject->expects($this->any())->method('getResultFileName')->willReturn(self::RESULT_FILE); + $ioObject->expects($this->any())->method('makeGeneratedClassFileName')->willReturn(self::RESULT_FILE); return [ 'source_class' => $mocks['source_class'], diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php index bae88f1e7291ffe9bc2fc7dd7318c4d6ad3edd58..e70255333e5f924a214c9c591d3f286e7454de6f 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php @@ -72,7 +72,7 @@ class IoTest extends \PHPUnit_Framework_TestCase public function testGetResultFileName() { $expectedFileName = self::GENERATION_DIRECTORY . '/class/name.php'; - $this->assertEquals($expectedFileName, $this->_object->getResultFileName(self::CLASS_NAME)); + $this->assertEquals($expectedFileName, $this->_object->makeGeneratedClassFileName(self::CLASS_NAME)); } /** diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php index c53a0973b0070cce60863a74c3eb988955444e75..54d46d6aee5524f0e0c885d31446b24184ad89c1 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php @@ -120,7 +120,7 @@ class GeneratorTest extends \PHPUnit_Framework_TestCase ->willReturn(true); $resultClassFileName = '/Magento/Path/To/Class.php'; - $this->ioObjectMock->expects($this->once())->method('getResultFileName')->willReturn($resultClassFileName); + $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName')->willReturn($resultClassFileName); $this->ioObjectMock->expects($this->once())->method('fileExists')->willReturn($fileExists); $includeFileInvokeCount = $fileExists ? 1 : 0; $this->ioObjectMock->expects($this->exactly($includeFileInvokeCount))->method('includeFile'); diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php index 78f5759d9fa77707de1e1c1bb1cf39b5c4596fdc..7902303e0dc2c815b081fd79f84df04b8bce008b 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php @@ -56,7 +56,7 @@ class InterceptorTest extends \PHPUnit_Framework_TestCase $this->classGeneratorMock->expects($this->once())->method('generate') ->will($this->returnValue('source code example')); $model->expects($this->once())->method('_validateData')->will($this->returnValue(true)); - $this->ioObjectMock->expects($this->any())->method('getResultFileName')->with('Exception_Interceptor'); + $this->ioObjectMock->expects($this->any())->method('makeGeneratedClassFileName')->with('Exception_Interceptor'); $this->assertEquals('', $model->generate()); } } diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php index 10bafa24672ad8ed72d942d6de81262d8f2434e8..3a16036528025d7af9e826ca44f6b4ca3dad660f 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ConverterTest.php @@ -105,7 +105,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase //Mocking generation $this->ioObjectMock->expects($this->any()) - ->method('getResultFileName') + ->method('makeGeneratedClassFileName') ->with(self::RESULT_CLASS_NAME) ->will($this->returnValue($resultFileName)); $this->ioObjectMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php index 80d63e0133df7c7f29651628d1e4285bd1748880..bc3c490c985a60fddeb21d6d9a082d2923cae233 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/FactoryTest.php @@ -34,7 +34,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase ] ); - $this->ioObjectMock->expects($this->once())->method('getResultFileName') + $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName') ->with('\Magento\Framework\ObjectManager\Code\Generator\SampleFactory') ->will($this->returnValue('sample_file.php')); $factoryCode = file_get_contents(__DIR__ . '/_files/SampleFactory.txt'); diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php index a2744ca17becda4478dff35173d9982b33ba2ae3..02dce376ffe4ee6c0ad7c6d1e7001b8ed4857588 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/GenerateRepositoryTest.php @@ -54,7 +54,7 @@ class GenerateRepositoryTest extends \PHPUnit_Framework_TestCase ); $this->ioObjectMock->expects($this->once()) - ->method('getResultFileName') + ->method('makeGeneratedClassFileName') ->with('\Magento\Framework\ObjectManager\Code\Generator\SampleRepository') ->willReturn('SampleRepository.php'); diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php index 4fb66556991ccaec70b2e361094db556448a3e23..3d4bf69304cba44fcf296a0873db5bcdff593633 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/ProxyTest.php @@ -34,7 +34,7 @@ class ProxyTest extends \PHPUnit_Framework_TestCase ); $sampleProxyCode = file_get_contents(__DIR__ . '/_files/SampleProxy.txt'); - $this->ioObjectMock->expects($this->once())->method('getResultFileName') + $this->ioObjectMock->expects($this->once())->method('makeGeneratedClassFileName') ->with('\Magento\Framework\ObjectManager\Code\Generator\Sample_Proxy') ->will($this->returnValue('sample_file.php')); $this->ioObjectMock->expects($this->once())->method('writeResultFile') diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php index 9f14464d01c877ddbb5c8e097c5d5646d1922e3e..900d24897ae966a14beb895f3d50d05c3940a125 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php @@ -41,7 +41,7 @@ class ExtensionGeneratorAutoloader return false; } - $resultFileName = $this->generatorIo->getResultFileName($className); + $resultFileName = $this->generatorIo->makeGeneratedClassFileName($className); if (!$this->generatorIo->fileExists($resultFileName)) { $this->generatorIo->makeResultFileDirectory($className);