/** * @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)); }
/** * @return void */ public function testCustomerLoginLoggedInTrue() { $customerId = 222; $visitorId = 333; $observerMock = $this->getObserverMock(111); $this->customerSessionMock->expects($this->once())->method('isLoggedIn')->willReturn(true); $this->customerSessionMock->expects($this->once())->method('getCustomerId')->willReturn($customerId); $this->customerVisitorMock->expects($this->once())->method('getId')->willReturn($visitorId); $this->reportEventMock->expects($this->once())->method('updateCustomerType')->with($visitorId, $customerId); $this->productCompModelMock->expects($this->once())->method('updateCustomerFromVisitor')->willReturnSelf(); $this->productCompModelMock->expects($this->once())->method('calculate')->willReturnSelf(); $this->productIndexMock->expects($this->once())->method('updateCustomerFromVisitor')->willReturnSelf(); $this->productIndexMock->expects($this->once())->method('calculate')->willReturnSelf(); $this->observer->execute($observerMock); }
/** * @param array $expectedEventData * @return void */ protected function prepareReportEventModel($expectedEventData) { $this->reportEventMock->expects($this->any())->method('setData')->with($expectedEventData)->willReturnSelf(); $this->reportEventMock->expects($this->any())->method('save')->willReturnSelf(); }