/** * Tests the payment-method:add command */ public function testAdd() { $site_name = 'site_name'; $payment_method_label = 'payment_method_label'; $workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock(); $this->payment_methods->expects($this->once())->method('get')->with($this->equalTo($payment_method_label))->willReturn($this->payment_method); $this->site->expects($this->once())->method('addPaymentMethod')->with($this->equalTo($this->payment_method->id))->willReturn($workflow); $workflow->expects($this->once())->method('wait')->with(); $this->payment_method->expects($this->once())->method('get')->with($this->equalTo('label'))->willReturn($payment_method_label); $this->site->expects($this->once())->method('get')->with($this->equalTo('name'))->willReturn($site_name); $this->logger->expects($this->once())->method('log')->with($this->equalTo('notice'), $this->equalTo('{method} has been applied to the {site} site.'), $this->equalTo(['method' => $payment_method_label, 'site' => $site_name])); $out = $this->command->add($site_name, $payment_method_label); $this->assertNull($out); }