Skip to content

Commit 8d11ec6

Browse files
author
Franziska
committed
ADD: a new test case for an issue in the PositionCalculator reported by Gregory via e-mail.
1 parent d45d522 commit 8d11ec6

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

tests/cases/parser/gregoryTest.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
3+
/**
4+
* gregoryTest.php
5+
*
6+
* Test case for PHPSQLParser from an issue reported by Gregory Luneau per e-mail.
7+
*
8+
* PHP version 5
9+
*
10+
* LICENSE:
11+
* Copyright (c) 2010-2015 Justin Swanhart and André Rothe
12+
* All rights reserved.
13+
*
14+
* Redistribution and use in source and binary forms, with or without
15+
* modification, are permitted provided that the following conditions
16+
* are met:
17+
* 1. Redistributions of source code must retain the above copyright
18+
* notice, this list of conditions and the following disclaimer.
19+
* 2. Redistributions in binary form must reproduce the above copyright
20+
* notice, this list of conditions and the following disclaimer in the
21+
* documentation and/or other materials provided with the distribution.
22+
* 3. The name of the author may not be used to endorse or promote products
23+
* derived from this software without specific prior written permission.
24+
*
25+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+
*
36+
* @author André Rothe <[email protected]>
37+
* @copyright 2010-2015 Justin Swanhart and André Rothe
38+
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
39+
* @version SVN: $Id$
40+
*
41+
*/
42+
namespace PHPSQLParser\Test\Parser;
43+
44+
use PHPSQLParser\PHPSQLParser;
45+
46+
class GregoryTest extends \PHPSQLParser\Test\AbstractTestCase {
47+
48+
public function testGregory() {
49+
$query = "
50+
SELECT * FROM project_relation pr
51+
JOIN Project_type2 t2 ON FIND_IN_SET(id , pr.projet_type2) AND FIND_IN_SET('FR' , t2.pays)
52+
";
53+
$p = $this->parser->parse ( $query, true );
54+
$this->log($p);
55+
$expected = getExpectedValue ( dirname ( __FILE__ ), 'gregory.serialized' );
56+
$this->assertEquals ( $expected, $p, 'position problems with multiple functions in joins' );
57+
}
58+
}
59+
?>

0 commit comments

Comments
 (0)