public function testTitle() { $this->item->expects($this->once())->method('setTitle')->with($this->equalTo($this->serializedTitle)); $response = $this->getResponse(); $repository = $this->getDefaultRepositoryMock($this->item); $em = $this->getEntityManager($repository); $listener = $this->getListener($this->factory, $this->securityContext, $em); $listener->onResponse($this->getEventMock($this->getRequest(), $response)); }
public function testDoUpdate() { $item = new NavigationHistoryItem(); $oldVisitedAt = $item->getVisitedAt(); $oldVisitCount = $item->getVisitCount(); $item->doUpdate(); $this->assertInstanceOf('DateTime', $item->getVisitedAt()); $this->assertNotEquals($oldVisitedAt, $item->getVisitedAt()); $this->assertNotEquals($oldVisitCount, $item->getVisitCount()); $this->assertEquals($oldVisitCount + 1, $item->getVisitCount()); }
/** * {@inheritDoc} */ public function doUpdate() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'doUpdate', array()); return parent::doUpdate(); }