/** @test */ function it_can_be_converted_an_array_for_the_api() { $payment = new Payment(); $payment->setAmount(300)->setCurrency('GBP')->setChargeDate('2014-05-19')->setDescription('My simple description')->setMandate(Mandate::fromArray(['id' => 'MD123'])); $this->assertEquals(['amount' => '300', 'currency' => 'GBP', 'charge_date' => '2014-05-19', 'description' => 'My simple description', 'links' => ['mandate' => 'MD123']], $payment->toArray()); }