diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php index 2b82c10311b050b091b56b9ff30d709e8ce060c5..9bd4cb649bb0d805ef03db011820b3f0c9e96e40 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->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . 'Factory')) + file_get_contents($this->_ioObject->generateResultFileName(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->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Proxy')) + file_get_contents($this->_ioObject->generateResultFileName(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->makeGeneratedClassFileName(self::CLASS_NAME_WITH_NAMESPACE . '\Interceptor') + $this->_ioObject->generateResultFileName(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 8f53d379a51248ca7db352ef9234afa16153a835..5ea51a6d56024ca4645bcd6d5bbda4c691b65580 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('makeGeneratedClassFileName') + ->method('generateResultFileName') ->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 fec3d96f8b539ad3088134a5a6139cf3e78de275..bdc11e49ddd360a0dfd281122ae7fef5b503a5c5 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('makeGeneratedClassFileName') + ->method('generateResultFileName') ->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 5d54d23f55f318ba2db7dfcef2c967531d83359e..1f7609b0e923ceff66ebb81d41786276b79d3700 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('makeGeneratedClassFileName') + ->method('generateResultFileName') ->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 39c8ae07219c38ab893ef7d7c1785c00320e5919..2a572346e6a60bf2cb149a12f9c2a53d00e0b11d 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->makeGeneratedClassFileName($resultClass); + $generatedFileName = $this->_ioObject->generateResultFileName($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 d3ef4a0b54d3dc5c3ddc23d9fee0b19daeb6e4ec..aed8424282e8b3e7cfb5c292227752af728fd1c9 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->makeGeneratedClassFileName($this->_getResultClassName()); + $fileName = $this->_ioObject->generateResultFileName($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 d50b7fc8ae24abdd7feb1b28580e9e059d908c9d..365482c797c4ac937ede669be5e9246ca0d7d792 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->makeGeneratedClassFileName($className); + $fileName = $this->generateResultFileName($className); $pathParts = explode('/', $fileName); unset($pathParts[count($pathParts) - 1]); @@ -72,7 +72,7 @@ class Io * @param string $className * @return string */ - public function makeGeneratedClassFileName($className) + public function generateResultFileName($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 677685ce01612a61141538475de14eac73f3abf8..c10467f7cdf4bce65b4687cb90b9a700080a1ad7 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('makeGeneratedClassFileName')->willReturn(self::RESULT_FILE); + $ioObject->expects($this->any())->method('generateResultFileName')->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 e70255333e5f924a214c9c591d3f286e7454de6f..33b12746656a63722623aea045b237712ea6c75f 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->makeGeneratedClassFileName(self::CLASS_NAME)); + $this->assertEquals($expectedFileName, $this->_object->generateResultFileName(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 54d46d6aee5524f0e0c885d31446b24184ad89c1..c289ba47967435ded674df11cc9af595e280909e 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('makeGeneratedClassFileName')->willReturn($resultClassFileName); + $this->ioObjectMock->expects($this->once())->method('generateResultFileName')->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 7902303e0dc2c815b081fd79f84df04b8bce008b..97f1ff1b368d56130f72c8c61790f6e8e2a42f20 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('makeGeneratedClassFileName')->with('Exception_Interceptor'); + $this->ioObjectMock->expects($this->any())->method('generateResultFileName')->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 3a16036528025d7af9e826ca44f6b4ca3dad660f..8578107b4cf70fffe960aa52b2b9d11e9bf07070 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('makeGeneratedClassFileName') + ->method('generateResultFileName') ->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 bc3c490c985a60fddeb21d6d9a082d2923cae233..3a477ec43a52c4b6a56fcc4235554fdd8585288e 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('makeGeneratedClassFileName') + $this->ioObjectMock->expects($this->once())->method('generateResultFileName') ->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 02dce376ffe4ee6c0ad7c6d1e7001b8ed4857588..27cea41af83218ebb2810b1763e897ab1d1710c7 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('makeGeneratedClassFileName') + ->method('generateResultFileName') ->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 3d4bf69304cba44fcf296a0873db5bcdff593633..7eb9795742d1f7ce96b369e8c057e7d15b1d540e 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('makeGeneratedClassFileName') + $this->ioObjectMock->expects($this->once())->method('generateResultFileName') ->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 900d24897ae966a14beb895f3d50d05c3940a125..4382d23df89eeac89e54fddbaba8df862dcc6262 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->makeGeneratedClassFileName($className); + $resultFileName = $this->generatorIo->generateResultFileName($className); if (!$this->generatorIo->fileExists($resultFileName)) { $this->generatorIo->makeResultFileDirectory($className);