function testCreateAccount() { $collection = $this->getMock('\\RESTful\\Collection', array('create'), array('\\Balanced\\Account', 'some/uri', null)); $collection->expects($this->once())->method('create')->with(array('email_address' => '*****@*****.**', 'meta' => array('test#' => 'test_d'))); $marketplace = new Marketplace(array('accounts' => $collection)); $marketplace->createAccount('*****@*****.**', array('test#' => 'test_d')); }