public function MatcherTest::testDisabledEngines in CRM Core 8.2
Tests disabled engines are not executed.
File
- modules/
crm_core_match/ tests/ src/ Unit/ MatcherTest.php, line 198 - Contains \Drupal\Tests\crm_core_match\Unit\MatcherTest.
Class
- MatcherTest
- Tests the matcher service.
Namespace
Drupal\Tests\crm_core_match\UnitCode
public function testDisabledEngines() {
// $engine_config = $this->getMockBuilder('\Drupal\Core\Config\Config')
// ->disableOriginalConstructor()
// ->getMock();
//
// $this->config->expects($this->once())
// ->method('get')
// ->with('engines')
// ->will($this->returnValue($engine_config));
//
// $engine_config->expects($this->exactly(2))
// ->method('get')
// ->will($this->returnValueMap(array(
// array('a.status', TRUE),
// array('b.status', FALSE),
// )));
//
// $definitions = array(
// 'a' => array('priority' => 5),
// 'b' => array('priority' => 11),
// );
// $this->pluginManager->expects($this->once())
// ->method('getDefinitions')
// ->will($this->returnValue($definitions));
//
// $this->pluginManager->expects($this->once())
// ->method('createInstance')
// ->with('a', $definitions['a'])
// ->will($this->returnValue($this->engine['a']));
//
// $this->engine['a']->expects($this->once())
// ->method('match')
// ->with($this->contact)
// ->will($this->returnValue(array()));
//
// $this->engine['b']->expects($this->never())
// ->method('match');
//
// $this->assertEquals(1, count($this->matcher->getEngines()));
//
// $this->matcher->match($this->contact);
}