Changeset 10122
- Timestamp:
- 07/04/08 18:08:38 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderRelationsTest.php
r10120 r10122 140 140 141 141 $finder = sfPropelFinder::from('Article')->join('Comment'); 142 $join = array_pop($finder->getCriteria()->getJoins()); 142 $joins = $finder->getCriteria()->getJoins(); 143 $join = array_pop($joins); 143 144 $t->is($join->getJoinType(), null, 'join() ends up in a simple join'); 144 145 $t->is($join->getLeftColumnName(), 'ID', 'join($table) guesses the left column name'); … … 148 149 149 150 $finder = sfPropelFinder::from('Article')->join('Comment', Criteria::LEFT_JOIN); 150 $join = array_pop($finder->getCriteria()->getJoins()); 151 $joins = $finder->getCriteria()->getJoins(); 152 $join = array_pop($joins); 151 153 $t->is($join->getJoinType(), 'LEFT JOIN', 'join($table, $type) creates a typed join'); 152 154 $t->is($join->getLeftColumnName(), 'ID', 'join($table, $type) guesses the left column name'); … … 156 158 157 159 $finder = sfPropelFinder::from('Article')->join('Article.Id', 'Comment.ArticleId', Criteria::LEFT_JOIN); 158 $join = array_pop($finder->getCriteria()->getJoins()); 160 $joins = $finder->getCriteria()->getJoins(); 161 $join = array_pop($joins); 159 162 $t->is($join->getJoinType(), 'LEFT JOIN', 'join($start, $end, $type) creates a typed join'); 160 163 $t->is($join->getLeftColumnName(), 'ID', 'join($start, $end, $type) converts the left column name'); … … 239 242 240 243 $finder = sfPropelFinder::from('Article')->leftJoin('Comment'); 241 $join = array_pop($finder->getCriteria()->getJoins()); 244 $joins = $finder->getCriteria()->getJoins(); 245 $join = array_pop($joins); 242 246 $t->is($join->getJoinType(), 'LEFT JOIN', 'leftJoin($table) ends up in a left join'); 243 247 $finder = sfPropelFinder::from('Article')->rightJoin('Comment'); 244 $join = array_pop($finder->getCriteria()->getJoins()); 248 $joins = $finder->getCriteria()->getJoins(); 249 $join = array_pop($joins); 245 250 $t->is($join->getJoinType(), 'RIGHT JOIN', 'rightJoin($table) ends up in a right join'); 246 251 $finder = sfPropelFinder::from('Article')->innerJoin('Comment'); 247 $join = array_pop($finder->getCriteria()->getJoins()); 252 $joins = $finder->getCriteria()->getJoins(); 253 $join = array_pop($joins); 248 254 $t->is($join->getJoinType(), 'INNER JOIN', 'innerJoin($table) ends up in an inner join'); 249 255 250 256 $finder = sfPropelFinder::from('Article')->leftJoin('Article.Id', 'Comment.ArticleId'); 251 $join = array_pop($finder->getCriteria()->getJoins()); 257 $joins = $finder->getCriteria()->getJoins(); 258 $join = array_pop($joins); 252 259 $t->is($join->getJoinType(), 'LEFT JOIN', 'leftJoin($start, $end) creates a left join'); 253 260 $t->is($join->getLeftColumnName(), 'ID', 'leftJoin($start, $end) converts the left column name');