function testCreateCard() { $collection = $this->getMock('\\RESTful\\Collection', array('create'), array('\\Balanced\\Card', 'some/uri', null)); $collection->expects($this->once())->method('create')->with(array('street_address' => '123 Fake Street', 'city' => 'Jollywood', 'region' => '', 'postal_code' => '90210', 'name' => 'khalkhalash', 'card_number' => '4112344112344113', 'security_code' => '123', 'expiration_month' => 12, 'expiration_year' => 2013)); $marketplace = new Marketplace(array('cards' => $collection)); $marketplace->createCard('123 Fake Street', 'Jollywood', '', '90210', 'khalkhalash', '4112344112344113', '123', 12, 2013); }