/** * {@inheritDoc} * * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { /** @var DialogHelper $dialog */ $dialog = $this->getHelperSet()->get('dialog'); $wsdl = Validators::validateWsdl($input->getOption('wsdl')); $dir = Validators::validateTargetDir($input->getOption('dir')); $namespace = Validators::validateNamespace($input->getOption('namespace')); $licensePath = Validators::validateLicensePath($input->getOption('license-path')); if ($input->isInteractive()) { $this->writeSection($output, array(sprintf('Path to the wsdl file: "%s"', $wsdl), sprintf('The directory where to create proxy classes: "%s"', $dir), sprintf('The namespace of proxy classes to create: "%s"', $namespace))); if (!$dialog->askConfirmation($output, $this->getQuestion('Do you confirm generation', 'yes', '?'), true)) { $output->writeln('<error>Command aborted</error>'); return 1; } } $generator = new SimpleTypeAbstractGenerator($wsdl, $dir . 'SimpleType', $namespace . '\\SimpleType', array(), $licensePath); $generator->execute(); $generator = new ComplexTypeAbstractGenerator($wsdl, $dir . 'ComplexType', $namespace . '\\ComplexType', array($namespace . '\\SimpleType'), $licensePath); $generator->execute(); $generator = new SimpleTypeGenerator($wsdl, $dir . 'SimpleType', $namespace . '\\SimpleType', array(), $licensePath); $generator->execute(); $generator = new ComplexTypeGenerator($wsdl, $dir . 'ComplexType', $namespace . '\\ComplexType', array($namespace . '\\SimpleType'), $licensePath); $generator->execute(); $generator = new SoapClientGenerator($wsdl, $dir, $namespace, array('RuntimeException', 'SoapFault', 'SoapClient as BaseSoapClient'), $licensePath); $generator->execute(); $generator = new SoapServiceGenerator($wsdl, $dir, $namespace, array('RuntimeException', 'SoapFault', 'SoapClient as BaseSoapClient', 'InvalidArgumentException'), $licensePath); $generator->execute(); unset($generator); }
public function testSimpleTypeAbstractGenerator() { $generator = new SimpleTypeAbstractGenerator(self::$wsdlPath, self::$exportPath . '/SimpleType', self::$namespace . '\\SimpleType', array(), self::$licensePath); $generator->execute(); $reflection = new \ReflectionClass(self::$namespace . '\\SimpleType\\SimpleTypeAbstract'); $this->assertTrue($reflection->isAbstract()); $this->assertPublicMethod($reflection, '__toString'); }