Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tests for SQL errors after updating to propel1.6 #662

Open
wants to merge 1 commit into from

1 participant

@ibr

see #8

@ibr ibr Propel 1.5 compatibility tests
Tests for SQL generation problems found in Propel 1.6 which already
worked in version 1.5
39d604f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 16, 2013
  1. @ibr

    Propel 1.5 compatibility tests

    ibr authored
    Tests for SQL generation problems found in Propel 1.6 which already
    worked in version 1.5
This page is out of date. Refresh to see the latest.
Showing with 70 additions and 0 deletions.
  1. +70 −0 test/testsuite/runtime/query/CriteriaTest.php
View
70 test/testsuite/runtime/query/CriteriaTest.php
@@ -1180,6 +1180,76 @@ public function testDistinct()
$this->assertEquals('SELECT DISTINCT * FROM TABLE WHERE TABLE.string=:p1 AND TABLE.id=:p2', $result);
}
+
+ /**
+ * Propel 1.5 compatibility test
+ * SQL generation problems found in Propel 1.6 which already worked in version 1.5
+ * joins with tables in wrong order
+ */
+
+ public function testAddJoinsWithWrongTableOrder()
+ {
+ $c = new Criteria();
+
+ $c->addJoin(AuthorPeer::ID, BookPeer::AUTHOR_ID);
+ $c->addJoin(PublisherPeer::ID, BookPeer::PUBLISHER_ID);
+
+ try {
+ AuthorPeer::doCount($c);
+ } catch (Exception $e) {
+ print $e->getTraceAsString();
+ $this->fail("Exception thrown in AuthorPeer::doCount(): ". $e->getMessage());
+ }
+
+ $this->assertTrue(true);
+ }
+
+ /**
+ * Propel 1.5 compatibility test
+ * SQL generation problems found in Propel 1.6 which already worked in version 1.5
+ * several joins in wrong order
+ */
+
+ public function testAddSeveralJoinsInWrongOrder()
+ {
+ $c = new Criteria();
+
+ $c->addJoin(PublisherPeer::ID, BookstoreSalePeer::PUBLISHER_ID);
+ $c->addJoin(BookPeer::PUBLISHER_ID, PublisherPeer::ID);
+ $c->addJoin(AuthorPeer::ID, BookPeer::AUTHOR_ID);
+
+ try {
+ AuthorPeer::doCount($c);
+ } catch (Exception $e) {
+ print $e->getTraceAsString();
+ $this->fail("Exception thrown in AuthorPeer::doCount(): ". $e->getMessage());
+ }
+
+ $this->assertTrue(true);
+ }
+
+ /**
+ * Propel 1.5 compatibility test
+ * SQL generation problems found in Propel 1.6 which already worked in version 1.5
+ * doubled joins with different JoinTypes
+ */
+
+ public function testAddDoubledJoinsWithDifferentJoinTypes()
+ {
+ $c = new Criteria();
+
+ $c->addJoin(AuthorPeer::ID, BookPeer::AUTHOR_ID);
+ $c->addJoin(AuthorPeer::ID, BookPeer::AUTHOR_ID, Criteria::LEFT_JOIN);
+
+ try {
+ AuthorPeer::doCount($c);
+ } catch (Exception $e) {
+ print $e->getTraceAsString();
+ $this->fail("Exception thrown in AuthorPeer::doCount(): ". $e->getMessage());
+ }
+
+ $this->assertTrue(true);
+ }
}
class CriteriaForClearTest extends Criteria
Something went wrong with that request. Please try again.