RptMapWidgetTest.php in Search API Location 8
File
modules/facets_map_widget/tests/src/Unit/Plugin/widget/RptMapWidgetTest.php
View source
<?php
namespace Drupal\Tests\facets_map_widget\Unit\Plugin\widget;
use Drupal\facets_map_widget\Plugin\facets\widget\RptMapWidget;
use Drupal\Tests\facets\Unit\Plugin\widget\WidgetTestBase;
class RptMapWidgetTest extends WidgetTestBase {
public function setUp() {
parent::setUp();
$this->widget = new RptMapWidget([], 'rpt_map_widget', []);
}
public function testGetQueryType() {
$result = $this->widget
->getQueryType();
$this
->assertEquals('search_api_rpt', $result);
}
public function testDefaultConfiguration() {
$default_config = $this->widget
->defaultConfiguration();
$expected = [
'show_numbers' => FALSE,
];
$this
->assertEquals($expected, $default_config);
}
public function testIsPropertyRequired() {
$this
->assertFalse($this->widget
->isPropertyRequired('llama', 'owl'));
$this
->assertTrue($this->widget
->isPropertyRequired('rpt', 'processors'));
}
}