コード例 #1
1
 public function testWithInvalidFilter()
 {
     $this->initDB();
     $exitCode = Artisan::call('ticket:show', ['ticket' => 'xxx']);
     $this->assertEquals($exitCode, 0);
     $this->assertContains('No matching ticket was found.', Artisan::output());
 }
コード例 #2
1
 public function testNetBlockListCommandWithValidFilter()
 {
     $exitCode = Artisan::call('netblock:list', ['--filter' => '192.168.1.0']);
     $this->assertEquals($exitCode, 0);
     $this->assertContains('ISP Business Internet', Artisan::output());
     $this->assertNotContains('Customer 1', Artisan::output());
 }
コード例 #3
0
 public function testNotFoundFilter()
 {
     $this->initDB();
     $exitCode = Artisan::call('contact:list', ['--filter' => 'xxx']);
     $this->assertEquals($exitCode, 0);
     $this->assertContains('No contact found for given filter.', Artisan::output());
 }
コード例 #4
0
ファイル: Console.php プロジェクト: brosta/interframework
 public function makeMigration($name)
 {
     $name = $this->migrationName($name);
     if (!class_exists($name)) {
         Artisan::call('make:migration', ['name' => $name, '--create' => upperToUnderscore($name)]);
     }
 }
コード例 #5
0
 /**
  * Run the seed command for the given module
  * @param  SeedModuleRequest $request
  * @return mixed
  */
 public function seed(SeedModuleRequest $request)
 {
     $output = new BufferedOutput();
     Artisan::call('module:seed', ['module' => $request->module], $output);
     Flash::message($output->fetch());
     return Redirect::route('admin.workshop.workbench.index');
 }
コード例 #6
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $region = $this->argument('regionName');
     $this->mswSpotService->getSpotsInRegion($region)->each(function ($spot) {
         Artisan::call('msw:import-forecast', ['spotId' => $spot->id]);
     });
 }
コード例 #7
0
ファイル: ConsoleTest.php プロジェクト: damian-nz/l5-swagger
 /** @test */
 public function can_publish()
 {
     $this->setAnnotationsPath();
     Artisan::call('l5-swagger:publish');
     $this->assertTrue(file_exists(config_path('l5-swagger.php')));
     $this->assertTrue(file_exists(config('l5-swagger.paths.views') . '/index.blade.php'));
 }
コード例 #8
0
 public function close()
 {
     //filesystem
     $this->files = new Filesystem();
     //php artisan migrate:rollback
     $cmd = 'php artisan migrate:rollback';
     exec($cmd, $output);
     //php artisan delete:relation OrangeType Orange
     Artisan::call('delete:relation', (array) ['model_A' => 'OrangeType', 'model_B' => 'Orange']);
     //php artisan delete:scaffold OrangeType
     Artisan::call('delete:scaffold', (array) ['name' => 'OrangeType']);
     //php artisan delete:scaffold Orange
     Artisan::call('delete:scaffold', (array) ['name' => 'Orange']);
     //delete migration files
     $this->deleteMigration($models = ['orange_types', 'oranges']);
     //delete public/dog-ears/
     $this->files->deleteDirectory('./public/dog-ears');
     //delete common view files
     if ($this->files->exists('./resources/views/error.blade.php')) {
         $this->files->delete('./resources/views/error.blade.php');
     }
     if ($this->files->exists('./resources/views/layout.blade.php')) {
         $this->files->delete('./resources/views/layout.blade.php');
     }
     if ($this->files->exists('./resources/views/navi.blade.php')) {
         $this->files->delete('./resources/views/navi.blade.php');
     }
 }
コード例 #9
0
ファイル: Jumpstart.php プロジェクト: ScraperDave/Jumpstart
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $namespace = $this->getAppNamespace();
     $this->shouldBackup = 'n' === strtolower($this->askWithCompletion('Do you want to overwrite files when copying? (Saying \'no\' will create time-stamped copies of the originals.)', ['y', 'n']));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/app.blade.php', base_path('resources/views/app.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/home.blade.php', base_path('resources/views/home.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/welcome.blade.php', base_path('resources/views/welcome.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/auth/login.blade.php', base_path('resources/views/auth/login.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/auth/password.blade.php', base_path('resources/views/auth/password.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/auth/register.blade.php', base_path('resources/views/auth/register.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/views/auth/reset.blade.php', base_path('resources/views/auth/reset.blade.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/css/bootstrap-3.3.5.css.map', public_path('css/bootstrap-3.3.5.css.map'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/css/bootstrap-3.3.5.min.css', public_path('css/bootstrap-3.3.5.min.css'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/css/bootstrap-theme.css.map', public_path('css/bootstrap-theme.css.map'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/css/bootstrap-theme.min.css', public_path('css/bootstrap-theme.min.css'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/js/bootstrap-3.3.5.min.js', public_path('js/bootstrap-3.3.5.min.js'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/js/jquery-2.1.4.min.js', public_path('js/jquery-2.1.4.min.js'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/js/jquery-2.1.4.min.map', public_path('js/jquery-2.1.4.min.map'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/fonts/glyphicons-halflings-regular.eot', public_path('fonts/glyphicons-halflings-regular.eot'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/fonts/glyphicons-halflings-regular.svg', public_path('fonts/glyphicons-halflings-regular.svg'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/fonts/glyphicons-halflings-regular.ttf', public_path('fonts/glyphicons-halflings-regular.ttf'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/fonts/glyphicons-halflings-regular.woff', public_path('fonts/glyphicons-halflings-regular.woff'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/fonts/glyphicons-halflings-regular.woff2', public_path('fonts/glyphicons-halflings-regular.woff2'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/routes.php', app_path('Http/routes.php'));
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/Controllers/HomeController.php', base_path('app/Http/Controllers/HomeController.php'), $namespace);
     $this->copyJumpstartAsset(__DIR__ . '/../../assets/Controllers/WelcomeController.php', base_path('app/Http/Controllers/WelcomeController.php'), $namespace);
     $this->copyJumpstartMigrationAsset(__DIR__ . '/../../assets/database/migrations/_add_name_fields_to_users_table_jumpstart.php', base_path('database/migrations/' . Carbon::now()->format('Y_m_d_His') . '_add_name_fields_to_users_table_jumpstart.php'));
     $this->copyJumpstartMigrationAsset(__DIR__ . '/../../assets/database/migrations/_add_softdeletes_to_users_table_jumpstart.php', base_path('database/migrations/' . Carbon::now()->format('Y_m_d_His') . '_add_softdeletes_to_users_table_jumpstart.php'));
     if ('y' === strtolower($this->ask('Do you want to run the migrations?', 'y'))) {
         Artisan::call('migrate');
     }
 }
コード例 #10
0
ファイル: ListCommandTest.php プロジェクト: yoimbert/AbuseIO
 public function testNetBlockListCommandWithValidFilter()
 {
     $exitCode = Artisan::call('netblock:list', ["--filter" => "10.1.16.128"]);
     $this->assertEquals($exitCode, 0);
     $this->assertContains("Customer 6", Artisan::output());
     $this->assertNotContains("Global internet", Artisan::output());
 }
コード例 #11
0
 public function testWithValidFilter()
 {
     $this->initDB();
     $exitCode = Artisan::call('user:show', ['user' => $this->user->id]);
     $this->assertEquals($exitCode, 0);
     $this->assertContains($this->user->first_name, Artisan::output());
 }
コード例 #12
0
 /**
  * before each test runs
  * here we migrate if no migration and reset if migration already run
  * TODO: This is not working when Laravel5 transaction mode (cleanup=true in config) is activated, figure out why (eg error: no such table: users in routing/RegisterCest)
  *
  * @param TestEvent $e
  * @return bool
  */
 public function beforeTest(TestEvent $e)
 {
     // instantiate Codeception console output
     $output = new Output([]);
     // get laravel5 module
     $l5 = $this->getModule('Laravel5');
     // output error and die if transaction mode is active (this extension does not work with Laravel 5 transaction mode) TODO: figure out why
     if ($l5->config['cleanup']) {
         $output->writeln("\n" . "Please set Laravel5 Codeception module's cleanup to false (in tests/functional.suite.yml) before using NeilRussell6\\CodeceptionLaravel5Extensions\\ArtisanMigrateExtension." . "");
         die;
     }
     // get current migration status
     Artisan::call('migrate:status', ['--database' => $this->connection]);
     $status = Artisan::output();
     //var_dump($status);
     // ... if no migrations the run migrate
     if (str_contains($status, "No migrations found")) {
         Artisan::call('migrate', ['--database' => $this->connection]);
         //$result = Artisan::output();
         //var_dump($result);
     } else {
         Artisan::call('migrate:refresh', ['--database' => $this->connection]);
         //$result = Artisan::output();
         //var_dump($result);
     }
 }
コード例 #13
0
ファイル: ThemeController.php プロジェクト: Houbsi/Workshop
 public function publishAssets(Theme $theme)
 {
     try {
         Artisan::call('stylist:publish', ['theme' => $theme->getName()]);
     } catch (InvalidArgumentException $e) {
     }
 }
コード例 #14
0
 /** @test */
 public function optimized_class_is_created_in_production_environment()
 {
     $this->assertFileNotExists(base_path('bootstrap/cache/compiled.php'));
     Config::set('app.debug', false);
     Artisan::call('azure:optimize-classes');
     $this->assertFileExists(base_path('bootstrap/cache/compiled.php'));
 }
コード例 #15
0
 /**
  * Execute the console command.
  *
  * @return mixed
  * @throws \Gitonomy\Git\Exception\RuntimeException
  * @throws \Gitonomy\Git\Exception\InvalidArgumentException
  */
 public function handle()
 {
     $inspector = new Inspector($this->settings);
     $repository = $inspector->getRepositoryByUrl($this->argument('repositoryUrl'));
     $inspectedRepository = $inspector->inspectRepository($repository);
     $header = array_keys((array) $inspectedRepository[key($inspectedRepository)]);
     if (!$this->option('dry-run')) {
         $remote = $inspectedRepository['remote'];
         \Swis\GotLaravel\Models\Results::unguard();
         foreach ($inspectedRepository['results'] as $result) {
             $insert = $result->toArray();
             $insert['remote'] = $remote;
             $insert['author_slug'] = Str::slug($result->getAuthor());
             $insert['created_at'] = Carbon::createFromTimestamp($insert['date']);
             try {
                 \Swis\GotLaravel\Models\Results::updateOrCreate(array_only($insert, ['remote', 'filename', 'line']), $insert);
             } catch (\Exception $e) {
                 $this->error('Couldnt insert: ' . $e->getMessage() . PHP_EOL . print_r($insert, 1));
             }
         }
     }
     reset($inspectedRepository['results']);
     array_walk($inspectedRepository['results'], function (&$row) {
         $row = $row->toArray();
     });
     $this->info($inspectedRepository['remote']);
     $this->table($header, $inspectedRepository['results']);
     Artisan::call('got:normalize-names');
 }
コード例 #16
0
ファイル: DownSafe.php プロジェクト: valorin/l4-down-safe
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     // Check not 'sync'
     if (Config::get('queue.default') == "sync") {
         Artisan::call('down');
         $this->info("Application maintenance mode enabled.");
         return;
     }
     // Push job onto queue
     Queue::push(function ($job) {
         // Take Application down.
         Artisan::call('down');
         // Add Log message
         Log::info("Application is down, pausing queue while maintenance happens.");
         // Loop, waiting for app to come back up
         while (App::isDownForMaintenance()) {
             echo ".";
             sleep(5);
         }
         // App is back online, kill worker to restart daemon.
         Log::info("Application is up, rebooting queue.");
         Artisan::call('queue:restart');
         $job->delete();
     });
     // Wait until Maintenance Mode enabled.
     while (!App::isDownForMaintenance()) {
         sleep(1);
     }
     $this->info("Application maintenance mode enabled.");
 }
コード例 #17
0
ファイル: ModulesController.php プロジェクト: Houbsi/Workshop
 public function publishAssets(Module $module)
 {
     try {
         Artisan::call('module:publish', ['module' => $module->getName()]);
     } catch (InvalidArgumentException $e) {
     }
 }
コード例 #18
0
 public function handle()
 {
     $generator = (require resource_path('crud/generator.php'));
     foreach ($generator as $name => $config) {
         Artisan::call('crud:generate', $this->buildOptions($name, $config));
     }
 }
コード例 #19
0
ファイル: Kernel.php プロジェクト: revolucaodosbytes/ahoy-api
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('proxy:check')->twiceDaily();
     $schedule->command('proxy:fetch')->twiceDaily()->after(function () {
         Artisan::call('proxy:security');
     });
 }
コード例 #20
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $users = User::all();
     foreach ($users as $user) {
         Artisan::call('api-key:generate', ['--user-id' => $user->id]);
     }
 }
コード例 #21
0
 /** @test */
 public function it_throws_an_exception_for_invalid_configuration()
 {
     $this->app['config']->set('server-monitor.monitors.InvalidMonitor', [['alarmPercentage' => 75]]);
     $this->setExpectedException(InvalidConfiguration::class);
     $resultCode = Artisan::call('monitor:run');
     $this->assertNotEquals(0, $resultCode);
 }
コード例 #22
0
 public function refresh($action)
 {
     switch ($action) {
         case "application":
             Artisan::call('cache:clear');
             Flash::success('Limpeza do cache da aplicação concluído.');
             break;
         case "images":
             Artisan::call('image:clear');
             Flash::success('Limpeza do cache das imagens concluído.');
             break;
         case "views":
             Artisan::call('responsecache:clear');
             Artisan::call('view:clear');
             Flash::success('Limpeza do cache das views concluído.');
             break;
         case "routes":
             Artisan::call('route:clear');
             Flash::success('Limpeza do cache das rotas concluído.');
             break;
         case "clear-compiled":
             Artisan::call('clear-compiled');
             Flash::success('Limpeza do cache de otimização concluído.');
             break;
         case "routes-cache":
             Artisan::call('route:cache');
             Flash::success('Cache de rotas gerado com sucesso.');
             break;
         case "optimize":
             Artisan::call('optimize', ['--force' => true]);
             Flash::success('Cache de otimização gerado com sucesso.');
             break;
     }
     return ($url = session()->get('backUrl')) ? redirect($url) : redirect()->route('admin.mcache.index');
 }
コード例 #23
0
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     $this->client = new GuzzleHttp\Client(['base_uri' => 'http://*****:*****@gmail.com', 'secret']]);
 }
コード例 #24
0
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     $this->user = User::find(1);
     $this->user->logins = [$this->user->email, 'password'];
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('track_files', function (Blueprint $table) {
         $table->integer('filesize')->nullable()->unsigned();
     });
     // Populate file sizes
     Artisan::call('rebuild:filesizes', ['--force' => true]);
 }
コード例 #26
0
 public function trigger()
 {
     if (strtolower(Input::get('repository.full_name')) === strtolower(config('wikiclone.repository'))) {
         Artisan::call('wiki:update');
     } else {
         return response('Unauthorized action. (wrong repository)', 401);
     }
 }
コード例 #27
0
 public function testNetBlockListCommandWithValidFilter()
 {
     $exitCode = Artisan::call('user:list', ['--filter' => 'user']);
     $this->assertEquals($exitCode, 0);
     $output = Artisan::output();
     $this->assertContains('*****@*****.**', $output);
     $this->assertNotContains('*****@*****.**', $output);
 }
コード例 #28
0
 /**
  * A basic installation action defined for setting up database tables
  * for your package
  * 
  * @author Neelkanth Kaushik
  * @version 1.0.0
  */
 public function install()
 {
     \Illuminate\Support\Facades\Artisan::call('migrate', array('--path' => '/vendor/packagename/application/src/database/migrations/'));
     echo "<h2>Package Tables Created Succesfully.</h2>";
     \Illuminate\Support\Facades\Artisan::call('db:seed', ['--class' => 'Package\\Application\\database\\seeds\\PackageTableSeeder']);
     echo "<br/>";
     echo "<h2>Package Tables Seeded Successfully.</h2>";
 }
コード例 #29
0
 public function testNetBlockShowWithStartEndFilter()
 {
     $this->initDB();
     $ip = $this->netblock->last_ip;
     $exitCode = Artisan::call('netblock:show', ['netblock' => $ip]);
     $this->assertEquals($exitCode, 0);
     $this->assertContains($this->netblock->contact->name, Artisan::output());
 }
コード例 #30
0
 public function testFilter()
 {
     $exitCode = Artisan::call('collector:list', ['--filter' => 'Rbl']);
     $this->assertEquals($exitCode, 0);
     $output = Artisan::output();
     $this->assertContains('Rbl', $output);
     $this->assertNotContains('Snds', $output);
 }