Skip to content

Instantly share code, notes, and snippets.

@jonphipps
Last active November 29, 2015 14:44
Show Gist options
  • Save jonphipps/e1b39fb0f05d218b09de to your computer and use it in GitHub Desktop.
Save jonphipps/e1b39fb0f05d218b09de to your computer and use it in GitHub Desktop.
<?php
class BulkUpdateModelTest extends TestCase
{
/** @expectedException ReflectionException */
public function testItthrowsAnException_if_the_requested_model_is_invalid()
{
$status = $this->artisan('mynamespace:bulkupdate',['model' => 'foo']);
}
public function testItDisplaysAnError_if_the_requested_model_is_invalid()
{
$kernel = $this->app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArrayInput(array(
'command' => 'mynamespace:bulkupdate',
'model' => 'foo',
)),
$output = new Symfony\Component\Console\Output\BufferedOutput
);
$this->assertContains('Class \App\Models\foo does not exist', $output->fetch());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment