public function testGenerate() { $this->filesystem->exists(Argument::type('string'))->willReturn(false); $this->filesystem->put(Argument::type('string'), Argument::type('string'))->willReturn(null); $classPath = $this->generator->generate(); $this->assertContains('Version_', $classPath); }
public function onDispatch(MvcEvent $e) { if (!$e->getRequest() instanceof ConsoleRequest) { throw new RuntimeException('You can only use this action from a console!'); } $classPath = $this->generator->generate(); $response = sprintf("Generated skeleton class @ %s\n", realpath($classPath)); $e->setResult($response); return $response; }