public function it_should_return_true_if_news_exist_on_id(HttpClient $client, Container $ioc, NewsInterface $news)
 {
     $id = 3;
     $criteria = ['Id' => $id];
     $caseSensitive = true;
     $options = ['$filter' => $this->criteriaToFilter($criteria, $caseSensitive), '$skip' => 0, '$top' => 1];
     $client->get('News/Get', $options)->shouldBeCalled()->willReturn(Helper::contentResponse([Helper::fakeNews(['Id' => $id])]));
     $ioc->make($this->fqnModel())->shouldBeCalled()->willReturn($news);
     $this->has($id)->shouldReturn(true);
 }
Exemple #2
0
 public function it_should_throw_on_delete_if_news_doesnt_exist(HttpClient $client, Factory $factory)
 {
     $this->beConstructedWith($client, $factory, Helper::fakeNews(['Id' => null, 'Date' => null]));
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\RequirementException')->duringDelete();
 }