コード例 #1
0
 /**
  * Test the command.
  */
 public function testShouldCommandRun()
 {
     $generator = new LangJsGenerator(new File(), __DIR__ . '/fixtures/lang');
     $command = new LangJsCommand($generator);
     $command->setLaravel($this->app);
     $code = $this->runCommand($command, ['target' => __DIR__ . '/output/lang.js']);
     $this->assertRunsWithSuccess($code);
     $this->assertFileExists(__DIR__ . '/output/lang.js');
     $template = __DIR__ . '/../src/Mariuzzo/LaravelJsLocalization/Generators/Templates/langjs_with_messages.js';
     $this->assertFileExists($template);
     $this->assertFileNotEquals($template, __DIR__ . '/output/lang.js');
 }
コード例 #2
0
 /**
  */
 public function testShouldIncludeNestedDirectoryFile()
 {
     $generator = new LangJsGenerator(new File(), $this->langPath, ['forum/thread']);
     $command = new LangJsCommand($generator);
     $command->setLaravel($this->app);
     $code = $this->runCommand($command, ['target' => $this->outputFilePath]);
     $this->assertRunsWithSuccess($code);
     $this->assertFileExists($this->outputFilePath);
     $contents = file_get_contents($this->outputFilePath);
     $this->assertContains('en.forum.thread', $contents);
 }