|
@@ 37-46 (lines=10) @@
|
| 34 |
|
* @expectedException \InvalidArgumentException |
| 35 |
|
* @expectedExceptionMessage Expected one of "recency,frequency,monetary" type, "wrong_type" given |
| 36 |
|
*/ |
| 37 |
|
public function testAddProviderFailed() |
| 38 |
|
{ |
| 39 |
|
/** @var \PHPUnit_Framework_MockObject_MockObject|RFMProviderInterface $provider */ |
| 40 |
|
$provider = $this->getMock('OroCRM\Bundle\AnalyticsBundle\Builder\RFMProviderInterface'); |
| 41 |
|
$provider->expects($this->once()) |
| 42 |
|
->method('getType') |
| 43 |
|
->will($this->returnValue('wrong_type')); |
| 44 |
|
|
| 45 |
|
$this->builder->addProvider($provider); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testAddProviderSuccess() |
| 49 |
|
{ |
|
@@ 48-57 (lines=10) @@
|
| 45 |
|
$this->builder->addProvider($provider); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testAddProviderSuccess() |
| 49 |
|
{ |
| 50 |
|
/** @var \PHPUnit_Framework_MockObject_MockObject|RFMProviderInterface $provider */ |
| 51 |
|
$provider = $this->getMock('OroCRM\Bundle\AnalyticsBundle\Builder\RFMProviderInterface'); |
| 52 |
|
$provider->expects($this->once()) |
| 53 |
|
->method('getType') |
| 54 |
|
->will($this->returnValue(RFMMetricCategory::TYPE_FREQUENCY)); |
| 55 |
|
|
| 56 |
|
$this->builder->addProvider($provider); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
/** |
| 60 |
|
* @param mixed $entity |