function testDebit() { $collection = $this->getMock('\\RESTful\\Collection', array('create'), array('\\Balanced\\Debit', 'some/uri', null)); $collection->expects($this->once())->method('create')->with(array('amount' => 9911, 'description' => 'something tangy', 'appears_on_statement_as' => 'BAL*TANG', 'meta' => null, 'source_uri' => null, 'on_behalf_of_uri' => null)); $account = new Account(array('debits' => $collection)); $account->debit(9911, 'BAL*TANG', 'something tangy'); }