예제 #1
0
 public function testUpdate()
 {
     $feed = new Feed();
     $feed->setId(3);
     $feed->setUnreadCount(44);
     $result = ['feeds' => [['id' => $feed->getId(), 'unreadCount' => $feed->getUnreadCount()]]];
     $this->feedService->expects($this->once())->method('update')->with($this->equalTo(4), $this->equalTo($this->user))->will($this->returnValue($feed));
     $response = $this->controller->update(4);
     $this->assertEquals($result, $response);
 }
예제 #2
0
 public function testUpdate()
 {
     $feed = new Feed();
     $feed->setId(3);
     $feed->setUnreadCount(44);
     $result = array('feeds' => array(array('id' => $feed->getId(), 'unreadCount' => $feed->getUnreadCount())));
     $url = array('feedId' => 4);
     $this->controller = $this->getPostController(array(), $url);
     $this->feedBusinessLayer->expects($this->once())->method('update')->with($this->equalTo($url['feedId']), $this->equalTo($this->user))->will($this->returnValue($feed));
     $response = $this->controller->update();
     $this->assertEquals($result, $response->getData());
 }