Ejemplo n.º 1
0
 /**
  * @dataProvider lifetimeValueProvider
  *
  * @param string $expectedSQL
  * @param string $result
  * @param null   $channel
  */
 public function testGetAccountLifetime($expectedSQL, $result, $channel = null)
 {
     $smt = $this->createFetchStatementMock([['sclr0' => $result]]);
     $this->getDriverConnectionMock($this->em)->expects($this->once())->method('prepare')->with($expectedSQL)->will($this->returnValue($smt));
     $account = $this->getMock('OroCRM\\Bundle\\AccountBundle\\Entity\\Account');
     $this->assertSame($result, $this->provider->getAccountLifeTimeValue($account, $channel));
 }
Ejemplo n.º 2
0
 public function testGetLifetimeValue()
 {
     $expectedResult = 12.33;
     $account = $this->getMock('OroCRM\\Bundle\\AccountBundle\\Entity\\Account');
     $channel = $this->getMock('OroCRM\\Bundle\\ChannelBundle\\Entity\\Channel');
     $this->provider->expects($this->once())->method('getAccountLifeTimeValue')->with($this->equalTo($account), $this->equalTo($channel))->will($this->returnValue($expectedResult));
     $this->assertSame($expectedResult, $this->extension->getLifetimeValue($account, $channel));
 }
Ejemplo n.º 3
0
 /**
  * @param Account $account
  * @param Channel $channel
  *
  * @return float
  */
 public function getLifetimeValue(Account $account, Channel $channel = null)
 {
     return $this->amountProvider->getAccountLifeTimeValue($account, $channel);
 }