for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\GBProd\ElasticsearchDataProviderBundle\DataProvider;
use GBProd\ElasticsearchDataProviderBundle\DataProvider\RegistryEntry;
use GBProd\ElasticsearchDataProviderBundle\DataProvider\DataProviderInterface;
/**
* Tests for DataProvider registry entry
*
* @author gbprod <[email protected]>
*/
class RegistryEntryTest extends \PHPUnit_Framework_TestCase
{
public function testGetProvidersEmptyIfNoProviders()
$provider = $this->getMock(DataProviderInterface::class);
$testedInstance = new RegistryEntry(
$provider,
'my_index',
'my_type'
);
$this->assertEquals(
$testedInstance->getProvider()
$testedInstance->getIndex()
'my_type',
$testedInstance->getType()
}
public function testMatch()
$this->getMock(DataProviderInterface::class),
$this->assertTrue(
$testedInstance->match('my_index', 'my_type')
$this->assertFalse(
$testedInstance->match('my_index', 'my_type_2')
$testedInstance->match('my_index', null)
$testedInstance->match('my_index_2', 'my_type')
$testedInstance->match(null, null)