setId() public method

Set id
public setId ( $id )
Exemplo n.º 1
0
 public function it_resolves_issue_from_request_data(Request $request, Issue $issue, ParameterBag $attributes)
 {
     $request->getRequestUri()->willReturn('/en/may2014/60/test-article.htm');
     $issue->getId()->willReturn(1);
     $issue->getNumber()->willReturn(10);
     $issue->getName()->willReturn("May 2014");
     $issue->getShortName()->willReturn("may2014");
     $language = new Language();
     $language->setId(1);
     $language->setCode("en");
     $issue->getLanguage()->willReturn($language);
     $issue->getLanguageId()->willReturn("1");
     $request->attributes = $attributes;
     $this->issueResolver($request)->shouldReturn($issue);
     $this->getIssueMetadata()->shouldBeLike(array("id" => 1, "number" => 10, "name" => "May 2014", "shortName" => "may2014", "code_default_language" => "en", "id_default_language" => "1"));
 }
Exemplo n.º 2
0
 public function it_resolves_issue_from_request_data(Request $request, Issue $issue, ParameterBag $attributes, $repository, $publication, $query)
 {
     $repository->findOneBy(array('publication' => $publication, 'shortName' => 'may2014'))->willReturn($issue);
     $repository->getIssue('en', $publication, 'may2014')->willReturn($query);
     $query->getOneOrNullResult()->willReturn($issue);
     $request->getRequestUri()->willReturn('/en/may2014/60/test-article.htm');
     $issue->getId()->willReturn(1);
     $issue->getNumber()->willReturn(10);
     $issue->getName()->willReturn("May 2014");
     $issue->getShortName()->willReturn("may2014");
     $language = new Language();
     $language->setId(1);
     $language->setCode("en");
     $issue->getLanguage()->willReturn($language);
     $issue->getLanguageId()->willReturn("1");
     $request->attributes = $attributes;
     $this->issueResolver($request)->shouldReturn($issue);
     $this->getIssueMetadata()->shouldBeLike(array("id" => 1, "number" => 10, "name" => "May 2014", "shortName" => "may2014", "code_default_language" => "en", "id_default_language" => "1"));
 }
 public function setId($id)
 {
     $this->__load();
     return parent::setId($id);
 }