コード例 #1
0
 /**
  * @return void
  */
 public function testAfterClean()
 {
     $this->eventMock->expects($this->once())->method('clean');
     $this->comparedMock->expects($this->once())->method('clean');
     $this->viewedMock->expects($this->once())->method('clean');
     $this->assertEquals($this->logResourceMock, $this->log->afterClean($this->subjectMock, $this->logResourceMock));
 }
コード例 #2
0
 /**
  * @return void
  */
 public function testCustomerLogout()
 {
     $observerMock = $this->getObserverMock(111);
     $this->productCompModelMock->expects($this->once())->method('purgeVisitorByCustomer')->willReturnSelf();
     $this->productCompModelMock->expects($this->once())->method('calculate')->willReturnSelf();
     $this->productIndexMock->expects($this->once())->method('purgeVisitorByCustomer')->willReturnSelf();
     $this->productIndexMock->expects($this->once())->method('calculate')->willReturnSelf();
     $this->observer->execute($observerMock);
 }
コード例 #3
0
 /**
  * @return void
  */
 public function testCustomerLoginLoggedInFalse()
 {
     $observerMock = $this->getObserverMock(111);
     $this->customerSessionMock->expects($this->once())->method('isLoggedIn')->willReturn(false);
     $this->customerSessionMock->expects($this->never())->method('getCustomerId');
     $this->customerVisitorMock->expects($this->never())->method('getId');
     $this->productCompModelMock->expects($this->never())->method('updateCustomerFromVisitor')->willReturnSelf();
     $this->productCompModelMock->expects($this->never())->method('calculate')->willReturnSelf();
     $this->productIndexMock->expects($this->never())->method('updateCustomerFromVisitor')->willReturnSelf();
     $this->productIndexMock->expects($this->never())->method('calculate')->willReturnSelf();
     $this->observer->execute($observerMock);
 }
コード例 #4
0
 /**
  * @param array $expectedViewedData
  * @return void
  */
 protected function prepareProductIndexMock($expectedViewedData)
 {
     $this->productIndexMock->expects($this->any())->method('setData')->with($expectedViewedData)->willReturnSelf();
     $this->productIndexMock->expects($this->any())->method('save')->willReturnSelf();
     $this->productIndexMock->expects($this->any())->method('calculate')->willReturnSelf();
 }