コード例 #1
0
ファイル: GeneratorTest.php プロジェクト: t4web/migrations
 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);
 }
コード例 #2
0
 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;
 }