. */ namespace Doctrine\Tests\ORM\Query; use Doctrine\ORM\Query\ParameterTypeInferer; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Types\Type; use PDO; require_once __DIR__ . '/../../TestInit.php'; class ParameterTypeInfererTest extends \Doctrine\Tests\OrmTestCase { public function providerParameterTypeInferer() { return array( array(1, Type::INTEGER), array("bar", PDO::PARAM_STR), array("1", PDO::PARAM_STR), array(new \DateTime, Type::DATETIME), array(array(2), Connection::PARAM_INT_ARRAY), array(array("foo"), Connection::PARAM_STR_ARRAY), array(array("1","2"), Connection::PARAM_STR_ARRAY), array(array(), Connection::PARAM_STR_ARRAY), ); } /** * @dataProvider providerParameterTypeInferer */ public function testParameterTypeInferer($value, $expected) { $this->assertEquals($expected, ParameterTypeInferer::inferType($value)); } }