本文整理汇总了PHP中Illuminate\Support\Facades\Artisan::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Artisan::output方法的具体用法?PHP Artisan::output怎么用?PHP Artisan::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Artisan
的用法示例。
在下文中一共展示了Artisan::output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNetBlockListCommandWithValidFilter
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());
}
示例2: beforeTest
/**
* 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[41m" . "Please set Laravel5 Codeception module's cleanup to false (in tests/functional.suite.yml) before using NeilRussell6\\CodeceptionLaravel5Extensions\\ArtisanMigrateExtension." . "[0m");
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);
}
}
示例3: testWithInvalidFilter
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());
}
示例4: testWithValidFilter
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());
}
示例5: testNotFoundFilter
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());
}
示例6: testSetSystemAccount
public function testSetSystemAccount()
{
$this->initDB();
$exitCode = Artisan::call('account:edit', ['id' => $this->account->id, '--systemaccount' => true]);
$this->assertEquals($exitCode, 0);
$this->assertContains('The account has been updated', Artisan::output());
$this->assertTrue((bool) Account::find($this->account->id)->systemaccount);
}
示例7: testNetBlockShowWithStartEndFilter
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());
}
示例8: testFilter
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);
}
示例9: testEnabled
public function testEnabled()
{
$this->initDB();
$exitCode = Artisan::call('role:edit', ['id' => $this->role->id, '--name' => 'some bogus value']);
$this->assertEquals($exitCode, 0);
$this->assertContains('The role has been updated', Artisan::output());
$this->assertEquals(Role::find($this->role->id)->name, 'some bogus value');
}
示例10: testJson
public function testJson()
{
$this->initDB();
$exitCode = Artisan::call('ticket:list', ['--json' => 'true']);
$this->assertEquals($exitCode, 0);
json_decode(Artisan::output());
$this->assertEquals(json_last_error(), JSON_ERROR_NONE);
}
示例11: testValidCreate
public function testValidCreate()
{
$faker = Factory::create();
$domainName = $faker->domainName;
Artisan::call('domain:create', ['name' => $domainName, 'contact_id' => Contact::all()->first()->id]);
$this->assertContains('The domain has been created', Artisan::output());
Domain::where('name', $domainName)->forceDelete();
}
示例12: testWithValidFilter
public function testWithValidFilter()
{
$exitCode = Artisan::call('role:list', ['--filter' => 'Abuse']);
$this->assertEquals($exitCode, 0);
$output = Artisan::output();
$this->assertContains('Abuse', $output);
$this->assertNotContains('System Administrator', $output);
}
示例13: testCreateValid
public function testCreateValid()
{
$brand = factory(Brand::class)->create();
Artisan::call('account:create', ['name' => 'test_dummy', 'brand_id' => $brand->id]);
$output = Artisan::output();
$this->assertContains('The account has been created', $output);
Account::where('name', 'test_dummy')->forceDelete();
$brand->forceDelete();
}
示例14: testChangeWithAutoPassword
public function testChangeWithAutoPassword()
{
$this->initDB();
$exitCode = Artisan::call('user:edit', ['user' => $this->dummy->id, '--autopassword' => 'some dummy value']);
$this->assertEquals($exitCode, 0);
$output = Artisan::output();
$this->assertContains('The user has been updated', $output);
$this->assertContains('Using auto generated password', $output);
}
示例15: testIfNoPasswordIsSuppliedPasswordIsGenerated
public function testIfNoPasswordIsSuppliedPasswordIsGenerated()
{
$user = factory(User::class)->make();
Artisan::call('user:create', ['--first_name' => $user->first_name, '--last_name' => $user->last_name, 'email' => $user->email, 'account' => 'Default', '--language' => $user->locale, '--disabled' => $user->disabled]);
$output = Artisan::output();
$this->assertUsers($user, $this->findUserWithOutput($output), $this->returnGeneratedPasswordWithOutput($output));
$this->assertContains('Using auto generated password: ', $output);
$this->assertContains('The user has been created', $output);
}