/** * Execute the command * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $generator = new Generator($this->getEntityManager()); $generator->setNsEntity($input->getOption('namespace-entity'))->setSuperclass($input->getOption('superclass'))->setSequencePrefix($input->getOption('sequence-prefix'))->setNsRepository($input->getOption('namespace-repository'))->setFilter($input->getArgument('filter')); $message = $generator->generate($input->getOption('directory')); $output->writeln($message); }
/** * @test */ public function fireまでの通し確認() { $expected = 1264; $mock = m::mock('SplFileObject', [__DIR__ . '/template.php', 'w']); $mock->shouldReceive('fwrite')->once()->andReturn($expected); $Gen = new Generator($mock); $Gen->setContents('FooBarBaxQux'); $actual = $Gen->fire(); $this->assertSame($expected, $actual); }