Skip to content

Instantly share code, notes, and snippets.

@settermjd
Last active February 8, 2016 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save settermjd/ef348b593507a8323137 to your computer and use it in GitHub Desktop.
Save settermjd/ef348b593507a8323137 to your computer and use it in GitHub Desktop.
The following test for Zend\Db\Sql\InsertTest fails. Yet I'd have thought it would pass.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'INSERT INTO foo ("col1", "col2", "col3") VALUES("val1", "val2", "val3")'
+'INSERT INTO "foo" ("col1", "col2", "col3", "0", "1", "2") VALUES ('0', '1', '2', 'val1', 'val2', 'val3')'
<?php
$this->insert
->into('foo')
->columns(['col1', 'col2', 'col3'])
->values(['val1', 'val2', 'val3']);
$this->assertEquals(
'INSERT INTO foo ("col1", "col2", "col3") VALUES("val1", "val2", "val3")',
$this->insert->getSqlString(new TrustingSql92Platform())
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment