コード例 #1
0
 public function it_get_account_funds(ParamFactory $paramFactory, Param $param, BetfairClientInterface $client, AdapterInterface $adapterInterface)
 {
     $paramFactory->create()->shouldBeCalled()->willReturn($param);
     $client->apiNgRequest("getAccountFunds", $param, "account")->shouldBeCalled()->willReturn("{account}");
     $adapterInterface->adaptResponse("{account}")->willReturn(array("account"));
     $this->getAccountFunds()->shouldReturn(array("account"));
 }
コード例 #2
0
 public function it_has_list_events(BetfairClientInterface $betfairClient, AdapterInterface $adapterInterface, ParamFactoryInterface $paramFactory, MarketFilterFactoryInterface $marketFilterFactory, ParamInterface $paramInterface, MarketFilterInterface $marketFilterInterface)
 {
     $this->it_create_empty_param_filter($marketFilterFactory, $paramFactory, $marketFilterInterface, $paramInterface);
     $betfairClient->apiNgRequest(Event::API_METHOD_NAME, $paramInterface, "betting")->shouldBeCalled()->willReturn("{response}");
     $adapterInterface->adaptResponse("{response}")->willReturn(array("response"));
     $this->listEvents()->shouldReturn(array("response"));
 }
コード例 #3
0
 public function it_return_all_event_type_filtered_by_ids(BetfairClientInterface $betfairClient, AdapterInterface $adapterInterface, ParamFactoryInterface $paramFactory, MarketFilterFactoryInterface $marketFilterFactory, ParamInterface $paramInterface, MarketFilterInterface $marketFilterInterface)
 {
     $eventTypeIds = array(1, 2);
     $this->it_create_empty_param_filter($marketFilterFactory, $paramFactory, $marketFilterInterface, $paramInterface);
     $marketFilterInterface->setEventTypeIds($eventTypeIds)->shouldBeCalled();
     $betfairClient->apiNgRequest(EventType::API_METHOD_NAME, $paramInterface, "betting")->shouldBeCalled()->willReturn("{response}");
     $adapterInterface->adaptResponse("{response}")->willReturn(array("response"));
     $this->getAllEventFilterByIds($eventTypeIds)->shouldReturn(array("response"));
 }
コード例 #4
0
 public function it_get_results(ParamFactory $paramFactory, ParamInterface $param, BetfairClientInterface $betfairClient, AdapterInterface $adapter)
 {
     $paramFactory->create()->shouldBeCalled()->willReturn($param);
     $param->setMarketFilter($this->marketFilter)->shouldBeCalled();
     $param->setLocale($this->locale)->shouldBeCalled();
     $betfairClient->apiNgRequest("default", $param, "betting")->shouldBeCalled()->willReturn("response");
     $adapter->adaptResponse("response")->shouldBeCalled();
     $this->getResults();
 }
コード例 #5
0
 public function it_get_market_catalogue_filtered_by(BetfairClientInterface $betfairClient, AdapterInterface $adapterInterface, ParamFactoryInterface $paramFactory, MarketFilterFactoryInterface $marketFilterFactory, ParamInterface $paramInterface, MarketFilterInterface $marketFilterInterface)
 {
     $eventIds = array(1, 2);
     $marketTypeCodes = array(1234, 5555);
     $this->it_create_empty_param_filter($marketFilterFactory, $paramFactory, $marketFilterInterface, $paramInterface);
     $marketFilterInterface->setEventIds($eventIds)->shouldBeCalled();
     $marketFilterInterface->setMarketTypeCodes($marketTypeCodes)->shouldBeCalled();
     $paramInterface->setMaxResults(MarketCatalogue::MAX_RESULT)->shouldBeCalled();
     $betfairClient->apiNgRequest(MarketCatalogue::API_METHOD_NAME, $paramInterface, "betting")->shouldBeCalled()->willReturn("{response}");
     $adapterInterface->adaptResponse("{response}")->willReturn(array("response"));
     $this->getMarketCatalogueFilteredBy($eventIds, $marketTypeCodes)->shouldReturn(array("response"));
 }
コード例 #6
0
 public function it_get_results(BetfairClientInterface $betfairClient, AdapterInterface $adapter)
 {
     $betfairClient->apiNgRequest("default", $this->param, "betting")->shouldBeCalled()->willReturn("response");
     $adapter->adaptResponse("response")->shouldBeCalled();
     $this->getResults();
 }