for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AmaTeam\ElasticSearch\Test\Suite\Unit\Mapping;
use AmaTeam\ElasticSearch\Mapping\PropertyMappingView;
use Codeception\Test\Unit;
use PHPUnit\Framework\Assert;
class PropertyMappingViewTest extends Unit
{
public function mergeDataProvider()
$variants = [];
$variants[] = [
[
(new PropertyMappingView())
->setTargetClass('alpha')
->setType('alpha')
->setParameter('alpha', 1)
->setParameter('beta', 1),
->setTargetClass('beta')
->setType('beta')
->setParameter('beta', 2),
->setParameter('gamma', 3)
],
->setParameters(['alpha' => 1, 'beta' => 2, 'gamma' => 3])
];
return $variants;
}
/**
* @param array $views
* @param PropertyMappingView $expectation
*
* @test
* @dataProvider mergeDataProvider
*/
public function shouldMergeAsExpected(array $views, PropertyMappingView $expectation)
$result = PropertyMappingView::merge(...$views);
Assert::assertEquals($expectation, $result);