public function testManger() { $this->assertInstanceOf('\\HelloWordPl\\SimpleEntityGeneratorBundle\\Lib\\Interfaces\\RenderableInterface', $this->testMethodManager); $this->assertInstanceOf('\\HelloWordPl\\SimpleEntityGeneratorBundle\\Lib\\Interfaces\\MethodInterface', $this->testMethodManager); $this->assertInstanceOf('\\HelloWordPl\\SimpleEntityGeneratorBundle\\Lib\\Items\\TestMethodManager', $this->testMethodManager); $this->assertEquals('testSetFullName', $this->testMethodManager->getPreparedName()); }
/** * @param TestMethodManager $testMethod * @return string * @throws RendererException */ protected function renderTestMethod(TestMethodManager $testMethod) { $template = $testMethod->getTemplate(); $tags = $testMethod->getTemplateTags(); $args[RenderableInterface::TAG_CLASS] = $testMethod->getMethod()->getClassManager()->getNamespace(); $args[RenderableInterface::TAG_METHOD_NAME] = $testMethod->getMethod()->getPreparedName(); $args[RenderableInterface::TAG_TEST_METHOD_NAME] = $testMethod->getPreparedName(); return $this->addNewLineAfter($this->addIndentation($this->replace($tags, $args, $template), self::INDENT_4_SPACES)); }
/** * init test class for entity * * @param TestClassManager $testClassManager * @return TestClassManager */ protected function generateAndFillTestClassMethods(TestClassManager $testClassManager) { $testMethods = new ArrayCollection(); foreach ($testClassManager->getClassManager()->getMethods() as $method) { $testMethod = new TestMethodManager(); $testMethod->setMethod($method); $testMethods->add($testMethod); } $testClassManager->setMethods($testMethods); return $testClassManager; }