I have to use hardcoded values for certain fields because at this moment we don’t have access to the real data.
When we do get access, I don’t want to go through a lot of work uncommenting.
Is it possible to keep this statement the way it is, except use ’25’ as the alias for ratecode?
IF(special.ratecode IS NULL, br.ratecode, special.ratecode) AS ratecode,
I have about 8 or so IF statements similar to this and I’m just too lazy ( even with vim ) to re-append while commenting out each if statement line by line. I would have to do this:
$sql = 'SELECT u.*,';
// IF ( special.ratecode IS NULL, br.ratecode, special.ratecode) AS ratecode
$sql.= '25 AS ratecode';
Can’t you create a fake database with the test data in it? That’s how I usually do database-related testing. If you’re attempting to write “real” unit tests or something, you might want to consider making mock objects for your DB layer, but IMHO that’s usually overkill. If you’re able to swap out SQL engines, you could even swap in something like SQLite for your local testing.