subject = new Sql(); } /** * @dataProvider valueProvider */ public function testCastValue($fieldName, $value, $expectedType) { $this->$expectedType($this->invokeMethod($this->subject, 'castValue', [$fieldName, $value])); } /** * @return array */ public function valueProvider() { return [ ['size', 1, 'assertIsInt'], ['size', 't1', 'assertIsString'], [Sql::DIAGNOSTIC_BANDWIDTH_SIZE, '12', 'assertIsInt'], [Sql::DIAGNOSTIC_INTENSIVE_BANDWIDTH_SIZE, '12.00', 'assertIsInt'], [Sql::DIAGNOSTIC_PERFORMANCE_COUNT, '12.33', 'assertIsInt'], [Sql::DIAGNOSTIC_BANDWIDTH_COUNT, 22, 'assertIsInt'], [Sql::DIAGNOSTIC_INTENSIVE_BANDWIDTH_COUNT, '33.02', 'assertIsInt'], [Sql::DIAGNOSTIC_OSVERSION, 10.0, 'assertIsString'], [Sql::DIAGNOSTIC_OSVERSION, '10.0', 'assertIsString'], [Sql::DIAGNOSTIC_OSVERSION, 8, 'assertIsString'], [Sql::DIAGNOSTIC_OSVERSION, '8', 'assertIsString'], [Sql::DIAGNOSTIC_BROWSERVERSION, 33.02, 'assertIsString'], [Sql::DIAGNOSTIC_BROWSERVERSION, 73, 'assertIsString'], ['another', '33.02', 'assertIsFloat'], ['another3', 'omg', 'assertIsString'], ['another2', 33.02, 'assertIsFloat'], ]; } }