Exemplo n.º 1
0
 public function testCompanyName()
 {
     $this->assertEquals('JOHND', Contact::find(1)->reference);
     $exitCode = Artisan::call('contact:edit', ['id' => '1', '--reference' => 'New reference']);
     $this->assertEquals($exitCode, 0);
     $this->assertContains('The contact has been updated', Artisan::output());
     $contact = Contact::find(1);
     $this->assertEquals('New reference', $contact->reference);
     $contact->reference = 'JOHND';
     $contact->save();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}.
  */
 protected function handleOptions($model)
 {
     $this->updateFieldWithOption($model, 'name');
     if ($this->option('contact_id')) {
         if (null === Contact::find($this->option('contact_id'))) {
             $this->error('Unable to find contact with this criteria');
             return false;
         }
     }
     $this->updateFieldWithOption($model, 'contact_id');
     $this->updateBooleanFieldWithOption($model, 'enabled');
     return true;
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}.
  */
 protected function getModelFromRequest()
 {
     return Contact::find($this->argument('id'));
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}.
  */
 protected function getObjectByArguments()
 {
     return Contact::find($this->argument('id'));
 }